autoflow icon indicating copy to clipboard operation
autoflow copied to clipboard

Downgrade migration version may drop all foreign keys on some table.

Open Mini256 opened this issue 1 year ago • 0 comments

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

Mini256 avatar Nov 15 '24 02:11 Mini256