dbsrgits / sql-translator

SQL::Translator (SQLFairy)

Home Page:http://sqlfairy.sourceforge.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SQLite diff producer creates broken foreign key constraints

andrewgregory opened this issue · comments

Since SQLite doesn't support altering existing columns, sql-translator achieves this by creating a new table with the correct schema and copying the data over. It first copies the data into a temporary table, though. If the table includes a foreign key constraint it cannot be satisfied because the temporary table is in a different SQLite schema. Should sql-translator create the new table in the main database so that foreign keys work or do applications need to disable (or just not enable to begin with) foreign key constraints for sql translator?