Skip to content

Commit

Permalink
MAINT: Fix downgrade to drop columns
Browse files Browse the repository at this point in the history
  • Loading branch information
mgxd committed Aug 31, 2022
1 parent 56d5bef commit 04de2d4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions alembic/versions/93c95bbf67a3_status_enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def upgrade() -> None:
status_type = psg.ENUM('R', 'C', 'F', 'S', name='status')
pt = create_adhoc_project_table(project, status_type)
op.alter_column(project, 'status', existing_typetype_=status_type, schema=schema)

op.add_column(project, sa.Column('status_desc', sa.String()), schema=schema)
op.add_column(project, sa.Column('error_type', sa.String()), schema=schema)
op.add_column(project, sa.Column('error_desc', sa.String()), schema=schema)
Expand All @@ -40,10 +39,9 @@ def downgrade() -> None:
for project in projects:
status_type = psg.VARCHAR(7)
op.alter_column(project, 'status', type_=status_type, schema=schema)

op.drop_column(project, 'status_desc', schema=schema)
op.add_column(project, 'error_type', schema=schema)
op.add_column(project, 'error_desc', schema=schema)
op.drop_column(project, 'error_type', schema=schema)
op.drop_column(project, 'error_desc', schema=schema)


def get_tracked_projects() -> list[str]:
Expand Down

0 comments on commit 04de2d4

Please sign in to comment.