querybook icon indicating copy to clipboard operation
querybook copied to clipboard

Alembic migration fails

Open baumandm opened this issue 3 years ago • 3 comments

The latest DB migration fails with the following error:

INFO  [alembic.runtime.migration] Running upgrade 17f7c039ab6e -> f449a73c5838, add boardEditor and board as board item
....
sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1553, "Cannot drop index 'board_item_ibfk_1': needed in a foreign key constraint")
[SQL: ALTER TABLE board_item CHANGE board_id parent_board_id INTEGER NOT NULL]

Workaround was to manually drop the constraint, then rerun the migration:

ALTER TABLE board_item DROP FOREIGN KEY board_item_ibfk_1;

baumandm avatar Jul 15 '22 15:07 baumandm

I've run into this a few times, but it doesn't reproduce when running all the migrations on a clean database. So not sure what the deal with this, can probably close unless anyone else has encountered it.

baumandm avatar Aug 29 '22 13:08 baumandm

@czgu can we get a fix for alembic migration f449a73c5838?

michael-pattern avatar Dec 06 '23 16:12 michael-pattern