On 2/26/16, Tristan Seligmann <mithrandi at mithrandi.net> wrote:
>
> PRAGMA writable_schema=on;
> UPDATE sqlite_master SET sql='CREATE TABLE some_table_name (..., storeID
> INTEGER PRIMARY KEY)' WHERE tbl_name='some_table_name';
>

I don't think that will work.  I believe you are going to need to copy
the table content.
Like this:

BEGIN;
ALTER TABLE some_table_name RENAME TO temp_name;
CREATE TABLE some_table_name(oid INTEGER PRIMARY KEY, ....);
INSERT INTO some_table_name SELECT oid, * FROM temp_name;
DROP TABLE temp_name;
COMMIT;


-- 
D. Richard Hipp
drh at sqlite.org

Reply via email to