In an SQLite DB, I have to transfer some records from two tables (old_warnings
and old_acknowledges
) to other two tables(new_warnings
and new_acknowledges
).
Transfering warnings
is not a problem.
INSERT INTO new_warnings (event, comment, value)
SELECT event, comment, value
FROM old_warnings
WHERE old_warnings.event = 'one';
However, the acknowledges
tables have the reference to the warning
(warning_id:integer) it refers to and if I transfer the acknowledges
first, I end up having the old warning_id
in the table. But, if I transfer the warnings
first, I don't have any reference to the new id
to insert in the new_acknowledges
table.
Any idea of how to handle this situation?