Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove 'reference' column since it's been removed #15

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions src/alembic/versions/004_214f62b149e9_drop_reference_column.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""drop 'reference' column

Revision ID: 214f62b149e9
Revises: fb033ef6de1b
Create Date: 2024-07-11 12:34:27.185019

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = "214f62b149e9"
down_revision: Union[str, None] = "fb033ef6de1b"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no data in this column so this migration is safe as it's written here.

op.drop_column("use_transaction_longitudinal", "reference")
op.drop_column("use_transaction_location", "reference")
op.drop_column("sale_transaction", "reference")


def downgrade() -> None:
op.add_column(
"use_transaction_longitudinal",
sa.Column("reference", sa.String()),
)
op.add_column(
"use_transaction_location", sa.Column("reference", sa.String())
)
op.add_column("sale_transaction", sa.Column("reference", sa.String()))
1 change: 0 additions & 1 deletion src/dmap_import/schemas/sale_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,4 @@ class SaleTransaction(SqlBase):
discount_amount = sa.Column(sa.BigInteger, nullable=True)
_exported_dtm = sa.Column(sa.DateTime, nullable=True)
promotion_id = sa.Column(sa.String(), nullable=True)
reference = sa.Column(sa.String(), nullable=True)
reference_notes = sa.Column(sa.String(), nullable=True)
1 change: 0 additions & 1 deletion src/dmap_import/schemas/use_transaction_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,5 +157,4 @@ class UseTransactionalLocation(SqlBase):
fare_rule_description = sa.Column(sa.String(), nullable=True)
_exported_dtm = sa.Column(sa.DateTime, nullable=True)
promotion_id = sa.Column(sa.String(), nullable=True)
reference = sa.Column(sa.String(), nullable=True)
reference_notes = sa.Column(sa.String(), nullable=True)
1 change: 0 additions & 1 deletion src/dmap_import/schemas/use_transaction_longitudinal.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,5 +155,4 @@ class UseTransactionalLongitudinal(SqlBase):
fare_rule_description = sa.Column(sa.String(), nullable=True)
_exported_dtm = sa.Column(sa.DateTime, nullable=True)
promotion_id = sa.Column(sa.String(), nullable=True)
reference = sa.Column(sa.String(), nullable=True)
reference_notes = sa.Column(sa.String(), nullable=True)
Loading