Skip to content

Commit

Permalink
Merge pull request #22 from mbta/gg-alter-zipcode-type
Browse files Browse the repository at this point in the history
fix: alter zipcode column to allow for characters
  • Loading branch information
grejdi-mbta authored Sep 16, 2024
2 parents 753e8cb + 66c1e78 commit a8ad5b6
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
"""alter customer_postal_code to varchar
Revision ID: 8638e949eea1
Revises: 775b2cf7ab94
Create Date: 2024-09-16 15:12:30.287594
"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "8638e949eea1"
down_revision: Union[str, None] = "775b2cf7ab94"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
op.alter_column("sale_transaction", "customer_postal_code", type_=sa.String())
op.alter_column("use_transaction_location", "customer_postal_code", type_=sa.String())
op.alter_column("use_transaction_longitudinal", "customer_postal_code", type_=sa.String())


def downgrade() -> None:
op.alter_column(
"sale_transaction",
"customer_postal_code",
type_=sa.BigInteger(),
postgresql_using="customer_postal_code::bigint",
)
op.alter_column(
"use_transaction_location",
"customer_postal_code",
type_=sa.BigInteger(),
postgresql_using="customer_postal_code::bigint",
)
op.alter_column(
"use_transaction_longitudinal",
"customer_postal_code",
type_=sa.BigInteger(),
postgresql_using="customer_postal_code::bigint",
)
1 change: 0 additions & 1 deletion src/cubic_loader/qlik/ods_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"EDW.DEVICE_DIMENSION",
"EDW.USE_TRANSACTION",
# comp b
# "EDW.PAYMENT_SUMMARY", Table has NULL values in PrimaryKey columns
"EDW.TXN_CHANNEL_MAP",
"EDW.CCH_AFC_TRANSACTION",
"EDW.PATRON_TRIP",
Expand Down

0 comments on commit a8ad5b6

Please sign in to comment.