Skip to content

Commit

Permalink
fix db migration downgrade actions (apache#12608)
Browse files Browse the repository at this point in the history
  • Loading branch information
QP Hou authored Nov 25, 2020
1 parent 54adda5 commit 8f29c6d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ def upgrade():

def downgrade():
"""Unapply Add DagRun run_type"""
op.drop_column("run_type")
op.drop_column("dag_run", "run_type")
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,4 @@ def downgrade():
with op.batch_alter_table('xcom') as bop:
bop.drop_constraint('pk_xcom', type_='primary')
bop.add_column(Column('id', Integer, primary_key=True))
bop.create_primary_key('pk_xcom', ['id'])
bop.create_index('idx_xcom_dag_task_date', ['dag_id', 'task_id', 'key', 'execution_date'])
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def _add_worker_uuid_table():
elif conn.dialect.name not in {"mssql"}:
columns_and_constraints.append(sa.CheckConstraint("one_row_id", name="kube_worker_one_row_id"))

table = op.create_table(WORKER_RESOURCEVERSION_TABLE, *columns_and_constraints)
table = op.create_table(WORKER_UUID_TABLE, *columns_and_constraints)

op.bulk_insert(table, [{"worker_uuid": ""}])

Expand Down

0 comments on commit 8f29c6d

Please sign in to comment.