Skip to content

Commit

Permalink
Merge pull request #787 from communitiesuk/drop_ingest_date_migration
Browse files Browse the repository at this point in the history
Migrations for dropping ingest_date column from Submission
  • Loading branch information
sc15zs authored Oct 15, 2024
2 parents 9dbdaa6 + b668158 commit bde3d77
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion db/migrations/.current-alembic-head
Original file line number Diff line number Diff line change
@@ -1 +1 @@
045_make_ingest_date_nullable
046_drop_ingest_date
33 changes: 33 additions & 0 deletions db/migrations/versions/046_drop_ingest_date.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""Drop ingest_date
Revision ID: 046_drop_ingest_date
Revises: 045_make_ingest_date_nullable
Create Date: 2024-10-15 13:56:14.650292
"""

import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = "046_drop_ingest_date"
down_revision = "045_make_ingest_date_nullable"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("submission_dim", schema=None) as batch_op:
batch_op.drop_column("ingest_date")

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("submission_dim", schema=None) as batch_op:
batch_op.add_column(sa.Column("ingest_date", postgresql.TIMESTAMP(), autoincrement=False, nullable=True))

# ### end Alembic commands ###

0 comments on commit bde3d77

Please sign in to comment.