Tuesday 10 March 2015

how to remove constaint from sqlite ???

SQLite does not support the alter table drop constraint command. You will need to create a new table without a constraint, transfer the data, then delete the old table.


CREATE TABLE child2 ( 
    id INTEGER PRIMARY KEY, 
    parent_id INTEGER,
    description TEXT
);
INSERT INTO child2 (id, parent_id, description)
   SELECT id, parent_id, description FROM CHILD;
DROP TABLE child;
ALTER TABLE child2 RENAME TO child;

No comments:

Post a Comment