Skip to content

Commit

Permalink
[DOP-16661] Schema digest must be unique
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfinus committed Jul 5, 2024
1 parent 1dc2219 commit b5f2850
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def upgrade() -> None:
sa.Column("fields", sa.JSON(), nullable=False),
sa.PrimaryKeyConstraint("id", name=op.f("pk__schema")),
)
op.create_index(op.f("ix__schema__digest"), "schema", ["digest"], unique=False)
op.create_index(op.f("ix__schema__digest"), "schema", ["digest"], unique=True)


def downgrade() -> None:
Expand Down
1 change: 1 addition & 0 deletions data_rentgen/db/models/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Schema(Base):
SQL_UUID,
nullable=False,
index=True,
unique=True,
default=_get_digest,
doc="Schema SHA-1 digest based on fields content. Currently this is in form of UUID",
)
Expand Down

0 comments on commit b5f2850

Please sign in to comment.