Adding ability to update / patch by sku, adding uniqueness constraint violation checks
This commit is contained in:
1 parent
af5343da0c
commit
d8db87c13e
13 files changed
+541
-13
No files matched your search
@@ -17,7 +17,9 @@ class AugmentedPart(Base):
|
||||
__tablename__ = "augmented_parts"
|
||||
|
||||
id: Mapped[int] = mapped_column(primary_key=True)
|
||||
sku: Mapped[str | None] = mapped_column(String, nullable=True, default=None)
|
||||
sku: Mapped[str | None] = mapped_column(
|
||||
String, nullable=True, unique=True, default=None
|
||||
)
|
||||
description: Mapped[str] = mapped_column(String, nullable=False)
|
||||
colour_id: Mapped[int] = mapped_column(
|
||||
ForeignKey("part_colours.id", ondelete="RESTRICT"), nullable=False
|
||||
|
||||
Reference in new issue
Block a user