Changeset f657e9c


Ignore:
Timestamp:
06/22/11 21:12:32 (10 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master, qt5
Children:
865aab6
Parents:
51529bd
Message:

Changed UNIQUE statements in the database table definition so that they make sense for multiple conferences and do no not prevent successful imports.

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/create_tables.sql

    r51529bd rf657e9c  
    1111    , timeslot_duration INTEGER
    1212    , active INTEGER DEFAULT 0
    13     , url VARCHAR UNIQUE
     13    , url VARCHAR
    1414    , map VARCHAR);
    1515
    1616CREATE TABLE TRACK ( id INTEGER  PRIMARY KEY AUTOINCREMENT  NOT NULL
    1717    , xid_conference INTEGER -- NOT NULL
    18     , name VARCHAR UNIQUE NOT NULL );
     18    , name VARCHAR NOT NULL
     19    , UNIQUE (xid_conference, name));
    1920
    2021CREATE TABLE ROOM ( id INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL
    2122    , xid_conference INTEGER -- NOT NULL
    22     , name VARCHAR UNIQUE NOT NULL
    23     , picture VARCHAR NOT NULL);
     23    , name VARCHAR NOT NULL
     24    , picture VARCHAR NOT NULL
     25    , UNIQUE (xid_conference, name));
    2426
    2527CREATE TABLE PERSON ( id INTEGER PRIMARY KEY  NOT NULL
    2628    , xid_conference INTEGER -- NOT NULL
    27     , name VARCHAR UNIQUE NOT NULL);
     29    , name VARCHAR NOT NULL
     30    , UNIQUE (xid_conference, name));
    2831
    2932CREATE TABLE EVENT ( xid_conference INTEGER  NOT NULL
  • src/sql/sqlengine.cpp

    r51529bd rf657e9c  
    117117            query.bindValue(":day_change", -QTime::fromString(aConference["timeslot_duration"],TIME_FORMAT).secsTo(QTime(0,0)));
    118118            query.bindValue(":active", confsList.count() > 0 ? 0 : 1);
    119             query.exec();
     119            if (!query.exec()) qDebug() << "Could not execute query to insert a conference:" << query.lastError();
    120120            aConference["id"] = query.lastInsertId().toString(); // 'id' is assigned automatically
    121121        }
Note: See TracChangeset for help on using the changeset viewer.