- Timestamp:
- 09/25/12 21:10:30 (10 years ago)
- Branches:
- master, qt5
- Children:
- 9bbd5ae
- Parents:
- 4403ab4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/dbschema001.sql
r4403ab4 r38b61bc 1 1 BEGIN TRANSACTION; 2 2 3 CREATE TABLE CONFERENCE(3 CREATE TABLE conference ( 4 4 id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 5 5 title VARCHAR NOT NULL, … … 15 15 ); 16 16 17 CREATE TABLE TRACK(17 CREATE TABLE track ( 18 18 id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 19 xid_conference INTEGER NOT NULL REFERENCES CONFERENCE(id),19 xid_conference INTEGER NOT NULL REFERENCES conference(id), 20 20 name VARCHAR NOT NULL, 21 21 UNIQUE (xid_conference, name) 22 22 ); 23 23 24 CREATE TABLE ROOM(24 CREATE TABLE room ( 25 25 id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 26 xid_conference INTEGER NOT NULL REFERENCES CONFERENCE(id),26 xid_conference INTEGER NOT NULL REFERENCES conference(id), 27 27 name VARCHAR NOT NULL, 28 28 picture VARCHAR, … … 30 30 ); 31 31 32 CREATE TABLE PERSON(32 CREATE TABLE person ( 33 33 id INTEGER NOT NULL, 34 xid_conference INTEGER NOT NULL REFERENCES CONFERENCE(id),34 xid_conference INTEGER NOT NULL REFERENCES conference(id), 35 35 name VARCHAR NOT NULL, 36 36 PRIMARY KEY (id, xid_conference) 37 37 ); 38 38 39 CREATE TABLE EVENT(40 xid_conference INTEGER NOT NULL REFERENCES CONFERENCE(id),39 CREATE TABLE event ( 40 xid_conference INTEGER NOT NULL REFERENCES conference(id), 41 41 id INTEGER NOT NULL, 42 42 start INTEGER NOT NULL, 43 43 duration INTEGER NOT NULL, -- duration of the event in seconds 44 xid_track INTEGER NOT NULL REFERENCES TRACK(id),44 xid_track INTEGER NOT NULL REFERENCES track(id), 45 45 type VARCHAR, 46 46 language VARCHAR, … … 55 55 ); 56 56 57 CREATE TABLE EVENT_PERSON(57 CREATE TABLE event_person ( 58 58 xid_conference INTEGER NOT NULL, 59 59 xid_event INTEGER NOT NULL, 60 60 xid_person INTEGER NOT NULL, 61 61 UNIQUE (xid_conference, xid_event, xid_person ) ON CONFLICT REPLACE, 62 FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id),63 FOREIGN KEY(xid_conference, xid_event) REFERENCES EVENT(xid_conference, id),64 FOREIGN KEY(xid_conference, xid_person) REFERENCES PERSON(xid_conference, id)62 FOREIGN KEY(xid_conference) REFERENCES conference(id), 63 FOREIGN KEY(xid_conference, xid_event) REFERENCES event(xid_conference, id), 64 FOREIGN KEY(xid_conference, xid_person) REFERENCES person(xid_conference, id) 65 65 ); 66 66 67 CREATE TABLE EVENT_ROOM(67 CREATE TABLE event_room ( 68 68 xid_conference INTEGER NOT NULL, 69 69 xid_event INTEGER NOT NULL, 70 70 xid_room INTEGER NOT NULL, 71 71 UNIQUE (xid_conference, xid_event, xid_room) ON CONFLICT REPLACE, 72 FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id),73 FOREIGN KEY(xid_conference, xid_event) REFERENCES EVENT(xid_conference, id),74 FOREIGN KEY(xid_conference, xid_room) REFERENCES ROOM(xid_conference, id)72 FOREIGN KEY(xid_conference) REFERENCES conference(id), 73 FOREIGN KEY(xid_conference, xid_event) REFERENCES event(xid_conference, id), 74 FOREIGN KEY(xid_conference, xid_room) REFERENCES room(xid_conference, id) 75 75 ); 76 76 77 CREATE TABLE LINK(77 CREATE TABLE link ( 78 78 id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, 79 79 xid_conference INTEGER NOT NULL, … … 82 82 url VARCHAR NOT NULL, 83 83 UNIQUE (xid_conference, xid_event , url) ON CONFLICT REPLACE, 84 FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id),85 FOREIGN KEY(xid_conference, xid_event) REFERENCES EVENT(xid_conference, id)84 FOREIGN KEY(xid_conference) REFERENCES conference(id), 85 FOREIGN KEY(xid_conference, xid_event) REFERENCES event(xid_conference, id) 86 86 ); 87 87
Note: See TracChangeset
for help on using the changeset viewer.