Changeset 38b61bc


Ignore:
Timestamp:
09/25/12 21:10:30 (10 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
9bbd5ae
Parents:
4403ab4
Message:

Changed table names to have small letters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/dbschema001.sql

    r4403ab4 r38b61bc  
    11BEGIN TRANSACTION;
    22
    3 CREATE TABLE CONFERENCE (
     3CREATE TABLE conference (
    44        id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
    55        title VARCHAR NOT NULL,
     
    1515);
    1616
    17 CREATE TABLE TRACK (
     17CREATE TABLE track (
    1818        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),
    2020        name VARCHAR NOT NULL,
    2121        UNIQUE (xid_conference, name)
    2222);
    2323
    24 CREATE TABLE ROOM (
     24CREATE TABLE room (
    2525        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),
    2727        name VARCHAR NOT NULL,
    2828        picture VARCHAR,
     
    3030);
    3131
    32 CREATE TABLE PERSON (
     32CREATE TABLE person (
    3333        id INTEGER NOT NULL,
    34         xid_conference INTEGER NOT NULL REFERENCES CONFERENCE(id),
     34        xid_conference INTEGER NOT NULL REFERENCES conference(id),
    3535        name VARCHAR NOT NULL,
    3636        PRIMARY KEY (id, xid_conference)
    3737);
    3838
    39 CREATE TABLE EVENT (
    40         xid_conference INTEGER NOT NULL REFERENCES CONFERENCE(id),
     39CREATE TABLE event (
     40        xid_conference INTEGER NOT NULL REFERENCES conference(id),
    4141        id INTEGER NOT NULL,
    4242        start INTEGER NOT NULL,
    4343        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),
    4545        type VARCHAR,
    4646        language VARCHAR,
     
    5555);
    5656
    57 CREATE TABLE EVENT_PERSON (
     57CREATE TABLE event_person (
    5858        xid_conference INTEGER NOT NULL,
    5959        xid_event INTEGER NOT NULL,
    6060        xid_person INTEGER NOT NULL,
    6161        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)
    6565);
    6666
    67 CREATE TABLE EVENT_ROOM (
     67CREATE TABLE event_room (
    6868        xid_conference INTEGER NOT NULL,
    6969        xid_event INTEGER NOT NULL,
    7070        xid_room INTEGER NOT NULL,
    7171        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)
    7575);
    7676
    77 CREATE TABLE LINK (
     77CREATE TABLE link (
    7878        id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
    7979        xid_conference INTEGER NOT NULL,
     
    8282        url VARCHAR NOT NULL,
    8383        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)
    8686);
    8787
Note: See TracChangeset for help on using the changeset viewer.