Changeset 0d4ecc2 for src/sql


Ignore:
Timestamp:
01/25/10 09:02:15 (12 years ago)
Author:
timkoma <timkoma@…>
Branches:
master, qt5
Children:
6dc0dbc
Parents:
e7340e1
Message:

search update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sql/sqlengine.cpp

    re7340e1 r0d4ecc2  
    233233        query.exec("CREATE TABLE CONFERENCE ( \
    234234            id INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL , \
    235             title VARCHAR NOT NULL , \
     235            title VARCHAR UNIQUE NOT NULL , \
    236236            subtitle VARCHAR, \
    237237            venue VARCHAR, \
     
    249249        query.exec("CREATE TABLE ROOM ( \
    250250            id INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL , \
    251             name VARCHAR NOT NULL , \
     251            name VARCHAR UNIQUE NOT NULL , \
    252252            picture VARCHAR NOT NULL)");
    253253
    254254        query.exec("CREATE TABLE PERSON ( \
    255255            id INTEGER PRIMARY KEY  NOT NULL , \
    256             name VARCHAR NOT NULL)");
     256            name VARCHAR UNIQUE NOT NULL)");
    257257
    258258        query.exec("CREATE TABLE EVENT ( \
     
    278278            xid_event INTEGER NOT NULL , \
    279279            xid_person INTEGER NOT NULL, \
    280             FOREIGN KEY(xid_conference, xid_event) REFERENCES EVENT(xid_conference, id), \
     280            FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id), \
     281            FOREIGN KEY(xid_event) REFERENCES EVENT(id), \
    281282            FOREIGN KEY(xid_person) REFERENCES PERSON(id))");
    282283
     
    285286            xid_event INTEGER NOT NULL , \
    286287            xid_room INTEGER NOT NULL, \
    287             FOREIGN KEY(xid_conference, xid_event) REFERENCES EVENT(xid_conference, id), \
     288            FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id), \
     289            FOREIGN KEY(xid_event) REFERENCES EVENT(id), \
    288290            FOREIGN KEY(xid_room) REFERENCES ROOM(id))");
    289291
     
    294296            name VARCHAR, \
    295297            url VARCHAR NOT NULL, \
    296             FOREIGN KEY(xid_conference, xid_event) REFERENCES EVENT(xid_conference, id))");
     298            FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id), \
     299            FOREIGN KEY(xid_event) REFERENCES EVENT(id)");
    297300    }
    298301    else
     
    315318    execQuery( db, "DROP TABLE IF EXISTS SEARCH_EVENT;");
    316319    // CREATE
    317     execQuery( db, "CREATE TABLE SEARCH_EVENT ( xid_conference INTEGER  NOT NULL, id INTEGER NOT NULL );");
     320    execQuery( db, "CREATE TEMP TABLE SEARCH_EVENT ( xid_conference INTEGER  NOT NULL, id INTEGER NOT NULL );");
    318321    // INSERT
    319322    QString query = QString("INSERT INTO SEARCH_EVENT ( xid_conference, id) "
Note: See TracChangeset for help on using the changeset viewer.