In SQlite it looks like it's impossible to use alter table to add foreign key constraints to a table http://stackoverflow.com/questions/1884818/how-do-i-add-a-foreign-key-to-an-existing-sqlite-3-6-21-table

The only way to deal with it, is by creating a new table with the constraint and move the old data to the new one.