querybook
querybook copied to clipboard
Alembic migration fails
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;
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.
@czgu can we get a fix for alembic migration f449a73c5838?