1 PRAGMA foreign_keys=ON; 2 3 CREATE TABLE company ( 4 name TEXT NOT NULL, 5 id INTEGER PRIMARY KEY, 6 somenum INTEGER 7 ); 8 9 ALTER TABLE user ADD COLUMN cid INTEGER NOT NULL REFERENCES company(id) ON DELETE CASCADE; 10 ALTER TABLE user ADD COLUMN sex INTEGER NOT NULL; 11 ALTER TABLE user ADD COLUMN hash TEXT NOT NULL; 12 ALTER TABLE user ADD COLUMN email TEXT NOT NULL; 13 CREATE UNIQUE INDEX unique_user__email ON user(email); 14 ALTER TABLE user ADD COLUMN image BLOB; 15 ALTER TABLE user ADD COLUMN name TEXT NOT NULL; 16 ALTER TABLE session ADD COLUMN userid INTEGER NOT NULL REFERENCES user(uid); 17 ALTER TABLE session ADD COLUMN token INTEGER NOT NULL; 18 ALTER TABLE session ADD COLUMN mtime INTEGER NOT NULL;