When creating a new HDB the database has invalid foreign key relations in them. This currently does not cause any error since foreign keys are apparently not checked, but nevertheless makes editing the DB in tools like SQLiteBrowser harder. (Also it somehow defeats the purpose of having the foreign key relations in the first place).
For example the table operation_implementation_variable has the following relation, mentioning the non-existing table operation_implementation_old:
This renames the existing table (which updates the foreign key relation to the new name) and then creates a new table with the old name, moves all the data and drops the old table. This causes the foreign keys to reference the non-existing old table.
The original intention of the code seems to be to rename a column. According to this answer on StackOverflow this is now possible using the ALTER TABLE query.
When creating a new HDB the database has invalid foreign key relations in them. This currently does not cause any error since foreign keys are apparently not checked, but nevertheless makes editing the DB in tools like SQLiteBrowser harder. (Also it somehow defeats the purpose of having the foreign key relations in the first place).
For example the table
operation_implementation_variable
has the following relation, mentioning the non-existing tableoperation_implementation_old
:It is cause the migration code for version 6:
This renames the existing table (which updates the foreign key relation to the new name) and then creates a new table with the old name, moves all the data and drops the old table. This causes the foreign keys to reference the non-existing old table.
The original intention of the code seems to be to rename a column. According to this answer on StackOverflow this is now possible using the
ALTER TABLE
query.