setup.sql (679B) [raw]
1 -- Start fresh 2 DROP TABLE parties; 3 DROP TABLE guests; 4 5 -- Parties just group a series of guests so they can RSVP for eachother 6 CREATE TABLE parties ( 7 id INTEGER PRIMARY KEY AUTOINCREMENT, 8 notes TEXT 9 ); 10 11 -- Guests store individual preferences for meals, etc 12 CREATE TABLE guests ( 13 id INTEGER PRIMARY KEY AUTOINCREMENT, 14 name VARCHAR(255) NOT NULL, 15 party_id INTEGER NOT NULL, 16 going INTEGER, 17 meal_choice VARCHAR(255), 18 19 FOREIGN KEY(party_id) REFERENCES parties(id) 20 ); 21 22 INSERT INTO parties (id) VALUES (1), (2), (3); 23 24 INSERT INTO guests (name, party_id) VALUES 25 ('Alex', 1), 26 ('Jennie', 1), 27 ('Matt', 2), 28 ('Sarah', 3), 29 ('Sarah''s plus 1', 3), 30 ('Sammy', 2);