🐛 fix(alembic): handle exception when altering column "user_id" in "flow" table to be nullable

🔥 chore(alembic): remove unnecessary code in downgrade function
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-10-26 23:21:44 -03:00
commit af593684c0

View file

@ -34,9 +34,12 @@ def upgrade() -> None:
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("flow", schema=None) as batch_op:
batch_op.alter_column(
"user_id", existing_type=sa.CHAR(length=32), nullable=False
)
try:
with op.batch_alter_table("flow", schema=None) as batch_op:
batch_op.alter_column(
"user_id", existing_type=sa.CHAR(length=32), nullable=False
)
except Exception:
pass
# ### end Alembic commands ###