Skip to content

Commit 24bba7f

Browse files
committed
truncate tables before changing
1 parent 237fcc2 commit 24bba7f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

epictrack-api/migrations/versions/2257493941e7_rename_work_columns.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818

1919
def upgrade():
20+
op.execute("TRUNCATE works CASCADE")
21+
op.execute("TRUNCATE works_history CASCADE")
2022
with op.batch_alter_table('works', schema=None) as batch_op:
2123
batch_op.alter_column('short_description', new_column_name='report_description')
2224
batch_op.alter_column('long_description', new_column_name='epic_description')

epictrack-api/migrations/versions/eed10a65e3c3_make_columns_not_nullable.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
def upgrade():
2020
# ### commands auto generated by Alembic - please adjust! ###
21+
op.execute("TRUNCATE works CASCADE")
22+
op.execute("TRUNCATE works_history CASCADE")
2123
with op.batch_alter_table('works', schema=None) as batch_op:
2224
batch_op.alter_column('eao_team_id',
2325
existing_type=sa.INTEGER(),

0 commit comments

Comments
 (0)