-
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.
feat: remove COMPLIANCE_REPORT document type
- Loading branch information
Showing
3 changed files
with
37 additions
and
2 deletions.
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
37 changes: 37 additions & 0 deletions
37
migrations/versions/c919c4501192_remove_compliance_doc_type.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,37 @@ | ||
"""remove compliance doc type | ||
Revision ID: c919c4501192 | ||
Revises: f9f53b0fd892 | ||
Create Date: 2023-11-28 16:31:35.726353 | ||
""" | ||
from alembic import op | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = "c919c4501192" | ||
down_revision = "f9f53b0fd892" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.execute( | ||
"""create type borrower_document_type_tmp as enum ('INCORPORATION_DOCUMENT', 'SUPPLIER_REGISTRATION_DOCUMENT', | ||
'BANK_NAME', 'BANK_CERTIFICATION_DOCUMENT', 'FINANCIAL_STATEMENT', 'SIGNED_CONTRACT', | ||
'SHAREHOLDER_COMPOSITION', 'CHAMBER_OF_COMMERCE', 'THREE_LAST_BANK_STATEMENT');""" | ||
) | ||
op.execute("""DELETE from borrower_document where type = 'COMPLIANCE_REPORT'""") | ||
|
||
op.execute( | ||
"""ALTER TABLE borrower_document ALTER COLUMN type TYPE borrower_document_type_tmp | ||
USING (type::text::borrower_document_type_tmp);""" | ||
) | ||
|
||
op.execute("""DROP TYPE borrower_document_type""") | ||
|
||
op.execute("""ALTER TYPE borrower_document_type_tmp RENAME TO borrower_document_type;""") | ||
|
||
|
||
def downgrade() -> None: | ||
pass |
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