I have an Sqlite3 table with a composite key that's not compatible with an upgrade I want to make. So I want to remove the composite key and replace it with a single integer rowid. According to http://www.sqlite.org/faq.html#q11, the only way to do this is to drop the table and recreate it with the new key:
BEGIN TRANSACTION;
CREATE TEMPORARY TABLE t1_backup(a,b);
INSERT INTO t1_backup SELECT a,b FROM t1;
DROP TABLE t1;
CREATE TABLE t1(a,b);
INSERT INTO t1 SELECT a,b FROM t1_backup;
DROP TABLE t1_backup;
COMMIT;
Are there any risks involved in doing this? Are there any places where the "INSERT INTO..." statement could go wrong or fail?