1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
BEGIN TRANSACTION; CREATE TABLE migrations ( version TEXT NOT NULL ); CREATE TABLE accounts ( name TEXT NOT NULL PRIMARY KEY CHECK (length(name) >= 2), password TEXT NOT NULL ); CREATE TABLE followers ( target TEXT NOT NULL, follower TEXT NOT NULL, FOREIGN KEY(target) REFERENCES accounts(name) ); COMMIT;