if (db.isValid() && db.isOpen())
{
- // track/activity has to be handled as the first, since it is necessary to get
- // track ID from the ACTIVITY table, or to create new ACTIVITY record
+ // track has to be handled as the first, since it is necessary to get
+ // track ID from the TRACK table, or to create new TRACK record
// and get the ID from newly created record
- QString queryExist = QString("SELECT id FROM activity WHERE name='%1'").arg(aEvent["track"]);
+ QString queryExist = QString("SELECT id FROM track WHERE name='%1'").arg(aEvent["track"]);
QSqlQuery resultExist(queryExist,db);
- // now we have to check whether ACTIVITY record with 'name' exists or not,
- // - if it doesn't exist yet, then we have to add that record to 'ACTIVITY' table
- // and assign autoincremented 'id' to aActivity
- // - if it exists, then we need to get its 'id' and assign it to aRoom
+ // now we have to check whether TRACK record with 'name' exists or not,
+ // - if it doesn't exist yet, then we have to add that record to 'TRACK' table
+ // - if it exists, then we need to get its 'id'
int actId = -1;
- if(resultExist.next()) // ACTIVITY record with 'name' already exists: we need to get its 'id'
+ if(resultExist.next()) // TRACK record with 'name' already exists: we need to get its 'id'
{
actId = resultExist.value(0).toInt();
}
- else // ACTIVITY record doesn't exist yet, need to create it
+ else // TRACK record doesn't exist yet, need to create it
{
QString values = QString("'%1'").arg(aEvent["track"]);
- QString query = QString("INSERT INTO activity (name) VALUES (%1)").arg(values);
+ QString query = QString("INSERT INTO track (name) VALUES (%1)").arg(values);
QSqlQuery result (query, db);
actId = result.lastInsertId().toInt(); // 'id' is assigned automatically
}
.arg("0") \
.arg("0");
- QString query = QString("INSERT INTO EVENT (xid_conference, id, start, duration, xid_activity, type, language, favourite, alarm) VALUES (%1)").arg(values);
+ QString query = QString("INSERT INTO EVENT (xid_conference, id, start, duration, xid_track, type, language, favourite, alarm) VALUES (%1)").arg(values);
QSqlQuery result (query, db);
//LOG_AUTOTEST(query);
day_change INTEGER, \
timeslot_duration INTEGER)");
- query.exec("CREATE TABLE ACTIVITY ( \
+ query.exec("CREATE TABLE TRACK ( \
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , \
name VARCHAR NOT NULL )");
id INTEGER NOT NULL , \
start INTEGER NOT NULL , \
duration INTEGER NOT NULL , \
- xid_activity INTEGER NOT NULL REFERENCES ACTIVITY(id), \
+ xid_track INTEGER NOT NULL REFERENCES TRACK(id), \
type VARCHAR, \
language VARCHAR, \
favourite INTEGER DEFAULT 0, \
alarm INTEGER DEFAULT 0, \
PRIMARY KEY (xid_conference,id), \
FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id) \
- FOREIGN KEY(xid_activity) REFERENCES ACTIVITY(id))");
+ FOREIGN KEY(xid_track) REFERENCES TRACK(id))");
#ifdef MAEMO
// TBD: MAEMO Virtual tables compatibility (waiting for Marek).