On Sun, Mar 14, 2010 at 10:05:14PM +0000, Simon Slavin scratched on the wall: > I was trying to work out if I could add a FOREIGN KEY to a table > after it is originally created, using the ALTER TABLE command. > Assuming that my database was originally created with 3.6.19 or > later, can I do this ?
The first paragraph: http://www.sqlite.org/lang_altertable.html SQLite supports a limited subset of ALTER TABLE. The ALTER TABLE command in SQLite allows the user to rename a table or to add a new column to an existing table. It is not possible to rename a column, remove a column, or add or remove constraints from a table. A FOREIGN KEY is a constraint. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Our opponent is an alien starship packed with atomic bombs. We have a protractor." "I'll go home and see if I can scrounge up a ruler and a piece of string." --from Anathem by Neal Stephenson _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users