Changeset 865aab6


Ignore:
Timestamp:
06/22/11 22:35:29 (10 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
63b2343
Parents:
f657e9c
Message:

Importing persons for multiple conferences works now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/create_tables.sql

    rf657e9c r865aab6  
    1515
    1616CREATE TABLE TRACK ( id INTEGER  PRIMARY KEY AUTOINCREMENT  NOT NULL
    17     , xid_conference INTEGER -- NOT NULL
     17    , xid_conference INTEGER NOT NULL
    1818    , name VARCHAR NOT NULL
    1919    , UNIQUE (xid_conference, name));
    2020
    21 CREATE TABLE ROOM ( id INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL
    22     , xid_conference INTEGER -- NOT NULL
     21CREATE TABLE ROOM ( id INTEGER PRIMARY KEY AUTOINCREMENT  NOT NULL
     22    , xid_conference INTEGER NOT NULL
    2323    , name VARCHAR NOT NULL
    2424    , picture VARCHAR NOT NULL
    2525    , UNIQUE (xid_conference, name));
    2626
    27 CREATE TABLE PERSON ( id INTEGER PRIMARY KEY  NOT NULL
    28     , xid_conference INTEGER -- NOT NULL
     27CREATE TABLE PERSON ( id INTEGER NOT NULL
     28    , xid_conference INTEGER NOT NULL
    2929    , name VARCHAR NOT NULL
    30     , UNIQUE (xid_conference, name));
     30    , UNIQUE (xid_conference, name)
     31    , PRIMARY KEY (id, xid_conference));
    3132
    3233CREATE TABLE EVENT ( xid_conference INTEGER  NOT NULL
     
    5455    , FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id)
    5556    , FOREIGN KEY(xid_conference, xid_event) REFERENCES EVENT(xid_conference, id)
    56     , FOREIGN KEY(xid_person) REFERENCES PERSON(id));
    57 
     57    , FOREIGN KEY(xid_conference, xid_person) REFERENCES PERSON(xid_conference, id));
    5858
    5959CREATE TABLE EVENT_ROOM ( xid_conference INTEGER NOT NULL
     
    6363    , FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id)
    6464    , FOREIGN KEY(xid_conference, xid_event) REFERENCES EVENT(xid_conference, id)
    65     , FOREIGN KEY(xid_room) REFERENCES ROOM(id));
     65    , FOREIGN KEY(xid_conference, xid_room) REFERENCES ROOM(xid_conference, id));
    6666
    6767CREATE TABLE LINK ( id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL
Note: See TracChangeset for help on using the changeset viewer.