-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix/pdct 664 update primary key constraint for physical document l…
…anguage table (#195) * PDCT-664 Updated primary key for physical doc language to include source. * PDCT-664 Created migration to add source to physical doc language PK.
- Loading branch information
1 parent
1ca3848
commit 688eedc
Showing
2 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
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,47 @@ | ||
""" | ||
Updated family doc primary key constraint to include language source | ||
Revision ID: 0026 | ||
Revises: 0025 | ||
Create Date: 2023-12-07 10:58:25.326939 | ||
""" | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "0026" | ||
down_revision = "0025" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.execute( | ||
""" | ||
ALTER TABLE physical_document_language | ||
DROP CONSTRAINT pk_physical_document_language; | ||
""" | ||
) | ||
op.execute( | ||
""" | ||
ALTER TABLE physical_document_language | ||
ADD CONSTRAINT pk_physical_document_language | ||
PRIMARY KEY (language_id, document_id, source); | ||
""" | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.execute( | ||
""" | ||
ALTER TABLE physical_document_language | ||
DROP CONSTRAINT pk_physical_document_language; | ||
""" | ||
) | ||
op.execute( | ||
""" | ||
ALTER TABLE physical_document_language | ||
ADD CONSTRAINT pk_physical_document_language | ||
PRIMARY KEY (language_id, document_id); | ||
""" | ||
) |
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