Sqlite: ALTER TABLE ADD COLUMN fail on OSX 10.4 | Comments (1)
Posted in Code on 5th February 2008, 11:03 pm by Stuart
I’ve been playing with some stuff in Django recently and having updated a model I wanted to add a column to the sqlite database. Unfortunately ALTER TABLE ADD COLUMN statements don’t work in sqlite3.1.3 which is the version installed in Tiger and all you’ll get is a SQL error message.
sqlite> ALTER TABLE snippets_snippet ADD COLUMN 'code' text;
SQL error: near "ADD": syntax error
So how to fix this? Good news fink install sqlite3 will get you version 3.2.8 and you’ll find it in /sw/bin/sqlite3

well, it is a very long time since you post your question … but I guess the error is because the ‘ signal after the COLUMN instruction … I think the correct form is:
ALTER TABLE snippets_snippet ADD COLUMN code text;