flask 遷移數據庫報錯
報錯:
sqlalchemy.exc.InternalError: (pymysql.err.InternalError) (1091, "Can't DROP 'users_ibfk_1'; check that column/key exists")
[SQL: ALTER TABLE users DROP FOREIGN KEY users_ibfk_1]
解決辦法:
將每個數據庫表類型InnoDB轉為 MyISAM
如果報錯ERROR 1217 (23000): Cannot delete or update a parent row: a foreign key constrain fails。
需要刪除每個表的外鍵限制
如果需要表類型InnoDB,遷移完在轉回去