-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use latest sqlalchemy that supports NULLS NOT DISTINCT * Add NULLS NOT DISTINCT to unique index * Fix bug as artefact builds shouldn't be generated randomly * Fix linting issues * Small change * Small change
- Loading branch information
Showing
7 changed files
with
260 additions
and
238 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
backend/migrations/versions/2023_06_20_1000-b33ee8dd41b1_use_nulls_not_distinct.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""Use nulls not distinct | ||
Revision ID: b33ee8dd41b1 | ||
Revises: 6a80dad01d24 | ||
Create Date: 2023-06-20 10:00:07.676129+00:00 | ||
""" | ||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "b33ee8dd41b1" | ||
down_revision = "6a80dad01d24" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.execute( | ||
"ALTER TABLE artefact_build " | ||
"DROP CONSTRAINT IF EXISTS artefact_build_artefact_id_architecture_revision_key" | ||
", ADD CONSTRAINT unique_artefact_build " | ||
"UNIQUE NULLS NOT DISTINCT (artefact_id, architecture, revision);" | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
op.execute( | ||
"ALTER TABLE artefact_build " | ||
"DROP CONSTRAINT IF EXISTS unique_artefact_build" | ||
", ADD CONSTRAINT artefact_build_artefact_id_architecture_revision_key " | ||
"UNIQUE (artefact_id, architecture, revision);" | ||
) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters