autoflow
autoflow copied to clipboard
Downgrade migration version may drop all foreign keys on some table.
The default create_foreign_key / drop_constraint method doesn't gernated constraint name by alembic, it may result in alembic drop all the foreign keys on table when downgrade migration version, eventually leading to unexpected performance rollback.
https://github.com/pingcap/tidb.ai/blob/b27a3066e8de1562cab821e5fca5963328afea5a/backend/app/alembic/versions/04d4f05116ed_.py#L90