Created
May 11, 2013 17:27
-
-
Save aaronpuchert/5560712 to your computer and use it in GitHub Desktop.
Alter table in SQLite. This is not possible directly, we need a workaround. This keeps foreign key relations from other tables alive.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE tab2 ( | |
columns TEXT); | |
INSERT INTO tab2 (columns) SELECT columns from tab; | |
DROP TABLE tab; | |
ALTER TABLE tab2 RENAME TO tab; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment