Skip to content

Commit

Permalink
add renames to second migration
Browse files Browse the repository at this point in the history
  • Loading branch information
trillville committed Jul 17, 2024
1 parent 625f7f7 commit 0b94109
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,21 @@


def upgrade():
op.execute("ALTER TABLE IF EXISTS grouping_records RENAME to grouping_records_old;")

op.execute("ALTER TABLE grouping_records_new RENAME TO grouping_records;")
for i in range(100):
op.execute(f"ALTER TABLE grouping_records_new_p{i} RENAME TO grouping_records_p{i};")

op.execute("DROP TABLE IF EXISTS grouping_records_old")


def downgrade():
pass
op.execute("ALTER TABLE IF EXISTS grouping_records RENAME TO grouping_records_new;")

for i in range(100):
op.execute(f"ALTER TABLE grouping_records_p{i} RENAME TO grouping_records_new_p{i};")

op.execute("ALTER TABLE grouping_records_old RENAME TO grouping_records;")

op.execute("DROP TABLE IF EXISTS grouping_records_new")

0 comments on commit 0b94109

Please sign in to comment.