-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added char limit to name, address, and parent name fields.
- Loading branch information
Nargis Sultani
committed
Nov 5, 2024
1 parent
965f0da
commit cad2870
Showing
5 changed files
with
154 additions
and
16 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
db_revisions/versions/6dd77f09fae6_add_char_limit_to_financial_institution_.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,43 @@ | ||
"""add char limit to financial institution table fields | ||
Revision ID: 6dd77f09fae6 | ||
Revises: 2ad66aaf4583 | ||
Create Date: 2024-11-05 09:28:35.233356 | ||
""" | ||
|
||
from typing import Sequence, Union | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision: str = "6dd77f09fae6" | ||
down_revision: Union[str, None] = "2ad66aaf4583" | ||
branch_labels: Union[str, Sequence[str], None] = None | ||
depends_on: Union[str, Sequence[str], None] = None | ||
|
||
|
||
def upgrade() -> None: | ||
with op.batch_alter_table("financial_institutions", schema=None) as batch_op: | ||
batch_op.alter_column("name", type_=sa.String(255), nullable=False) | ||
batch_op.alter_column("hq_address_street_1", type_=sa.String(255), nullable=False) | ||
batch_op.alter_column("hq_address_street_2", type_=sa.String(255), nullable=True) | ||
batch_op.alter_column("hq_address_street_3", type_=sa.String(255), nullable=True) | ||
batch_op.alter_column("hq_address_street_4", type_=sa.String(255), nullable=True) | ||
batch_op.alter_column("hq_address_city", type_=sa.String(255), nullable=False) | ||
batch_op.alter_column("parent_legal_name", type_=sa.String(255), nullable=True) | ||
batch_op.alter_column("top_holder_legal_name", type_=sa.String(255), nullable=True) | ||
|
||
|
||
def downgrade() -> None: | ||
with op.batch_alter_table("financial_institutions", schema=None) as batch_op: | ||
batch_op.alter_column("name", type_=sa.String, nullable=False) | ||
batch_op.alter_column("hq_address_street_1", type_=sa.String, nullable=False) | ||
batch_op.alter_column("hq_address_street_2", type_=sa.String, nullable=True) | ||
batch_op.alter_column("hq_address_street_3", type_=sa.String, nullable=True) | ||
batch_op.alter_column("hq_address_street_4", type_=sa.String, nullable=True) | ||
batch_op.alter_column("hq_address_city", type_=sa.String, nullable=False) | ||
batch_op.alter_column("parent_legal_name", type_=sa.String, nullable=True) | ||
batch_op.alter_column("top_holder_legal_name", type_=sa.String, nullable=True) |
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