Adding ability to update / patch by sku, adding uniqueness constraint violation checks

This commit is contained in:
Ian Roddis committed 2026-09-21 10:43:36 -03:00
1 parent af5343da0c
commit d8db87c13e
13 files changed
+541 -13

No files matched your search

@@ -0,0 +1,26 @@
"""augmented_parts_sku_unique
Revision ID: 1c2d3e4f5a6b
Revises: 0fec09fb6ae6
Create Date: 2026-09-21 00:00:00.000000
"""
from collections.abc import Sequence
from alembic import op
# revision identifiers, used by Alembic.
revision: str = "1c2d3e4f5a6b"
down_revision: str | None = "0fec09fb6ae6"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None
def upgrade() -> None:
with op.batch_alter_table("augmented_parts", schema=None) as batch_op:
batch_op.create_index("ix_augmented_parts_sku", ["sku"], unique=True)
def downgrade() -> None:
with op.batch_alter_table("augmented_parts", schema=None) as batch_op:
batch_op.drop_index("ix_augmented_parts_sku")