Here is a screenshot from SQLiteStudio:
It seems to be able to add constraints (primary key, not null, unique, etc) to a column after the table has been created. How can I do this programatically?
Here is a screenshot from SQLiteStudio:
It seems to be able to add constraints (primary key, not null, unique, etc) to a column after the table has been created. How can I do this programatically?
Found out:
ALTER TABLE bim RENAME TO sqlitestudio_temp_table;
CREATE TABLE bim (CHR INTEGER, SNP TEXT PRIMARY KEY, GDIST INTEGER, BP INTEGER, AL1 TEXT, AL2 TEXT);
INSERT INTO bim (CHR, SNP, GDIST, BP, AL1, AL2) SELECT CHR, SNP, GDIST, BP, AL1, AL2 FROM sqlitestudio_temp_table;
DROP TABLE sqlitestudio_temp_table;
It's creating a new table, sort of a hack.