-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
73 additions
and
14 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
strr-api/migrations/versions/20241213_2034_55b9517ed210_.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,42 @@ | ||
"""empty message | ||
Revision ID: 55b9517ed210 | ||
Revises: 0fb49e0b4707 | ||
Create Date: 2024-12-13 20:34:29.306635 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '55b9517ed210' | ||
down_revision = '0fb49e0b4707' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
old_options = ('BC_DRIVERS_LICENSE', 'PROPERTY_ASSESSMENT_NOTICE', 'SPEC_TAX_CONFIRMATION', 'HOG_DECLARATION', 'ICBC_CERTIFICATE_OF_INSURANCE', 'HOME_INSURANCE_SUMMARY', 'PROPERTY_TAX_NOTICE', 'UTILITY_BILL', 'GOVT_OR_CROWN_CORP_OFFICIAL_NOTICE', 'TENANCY_AGREEMENT', 'RENT_RECEIPT_OR_BANK_STATEMENT', 'LOCAL_GOVT_BUSINESS_LICENSE', 'OTHERS', 'STRATA_HOTEL_DOCUMENTATION', 'FRACTIONAL_OWNERSHIP_AGREEMENT', 'BCSC', 'COMBINED_BCSC_LICENCE') | ||
new_options = ('BC_DRIVERS_LICENSE', 'PROPERTY_ASSESSMENT_NOTICE', 'SPEC_TAX_CONFIRMATION', 'HOG_DECLARATION', 'ICBC_CERTIFICATE_OF_INSURANCE', 'HOME_INSURANCE_SUMMARY', 'PROPERTY_TAX_NOTICE', 'UTILITY_BILL', 'GOVT_OR_CROWN_CORP_OFFICIAL_NOTICE', 'TENANCY_AGREEMENT', 'RENT_RECEIPT_OR_BANK_STATEMENT', 'LOCAL_GOVT_BUSINESS_LICENSE', 'OTHERS', 'STRATA_HOTEL_DOCUMENTATION', 'FRACTIONAL_OWNERSHIP_AGREEMENT', 'BCSC', 'COMBINED_BCSC_LICENSE') | ||
|
||
old_type = sa.Enum(*old_options, name='documenttype') | ||
new_type = sa.Enum(*new_options, name='documenttype') | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.execute('ALTER TYPE documenttype RENAME TO tmp_documenttype') | ||
new_type.create(op.get_bind()) | ||
op.execute('ALTER TABLE documents ALTER COLUMN document_type TYPE documenttype USING document_type::text::documenttype') | ||
op.execute('ALTER TABLE documents_history ALTER COLUMN document_type TYPE documenttype USING document_type::text::documenttype') | ||
op.execute('DROP TYPE tmp_documenttype') | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.execute('ALTER TYPE documenttype RENAME TO tmp_documenttype') | ||
old_type.create(op.get_bind()) | ||
op.execute('ALTER TABLE documents ALTER COLUMN document_type TYPE documenttype USING document_type::text::documenttype') | ||
op.execute('ALTER TABLE documents_history ALTER COLUMN document_type TYPE documenttype USING document_type::text::documenttype') | ||
op.execute('DROP TYPE tmp_documenttype') | ||
# ### end Alembic commands ### |
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
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