Ignore:
Timestamp:
01/20/10 22:02:30 (12 years ago)
Author:
pavelpa <pavelpa@…>
Branches:
master, qt5
Children:
8fe9bd2
Parents:
926f106
Message:

changed 'Activity' -> 'Track'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sql/sqlengine.cpp

    r926f106 r4693fa6  
    8787    if (db.isValid() && db.isOpen())
    8888    {
    89         // track/activity has to be handled as the first, since it is necessary to get
    90         // track ID from the ACTIVITY table, or to create new ACTIVITY record
     89        // track has to be handled as the first, since it is necessary to get
     90        // track ID from the TRACK table, or to create new TRACK record
    9191        // and get the ID from newly created record
    92         QString queryExist = QString("SELECT id FROM activity WHERE name='%1'").arg(aEvent["track"]);
     92        QString queryExist = QString("SELECT id FROM track WHERE name='%1'").arg(aEvent["track"]);
    9393        QSqlQuery resultExist(queryExist,db);
    94         // now we have to check whether ACTIVITY record with 'name' exists or not,
    95         // - if it doesn't exist yet, then we have to add that record to 'ACTIVITY' table
    96         //   and assign autoincremented 'id' to aActivity
    97         // - if it exists, then we need to get its 'id' and assign it to aRoom
     94        // now we have to check whether TRACK record with 'name' exists or not,
     95        // - if it doesn't exist yet, then we have to add that record to 'TRACK' table
     96        // - if it exists, then we need to get its 'id'
    9897        int actId = -1;
    99         if(resultExist.next()) // ACTIVITY record with 'name' already exists: we need to get its 'id'
     98        if(resultExist.next()) // TRACK record with 'name' already exists: we need to get its 'id'
    10099        {
    101100            actId = resultExist.value(0).toInt();
    102101        }
    103         else // ACTIVITY record doesn't exist yet, need to create it
     102        else // TRACK record doesn't exist yet, need to create it
    104103        {
    105104            QString values = QString("'%1'").arg(aEvent["track"]);
    106             QString query = QString("INSERT INTO activity (name) VALUES (%1)").arg(values);
     105            QString query = QString("INSERT INTO track (name) VALUES (%1)").arg(values);
    107106            QSqlQuery result (query, db);
    108107            actId = result.lastInsertId().toInt(); // 'id' is assigned automatically
     
    123122                         .arg("0");
    124123
    125         QString query = QString("INSERT INTO EVENT (xid_conference, id, start, duration, xid_activity, type, language, favourite, alarm) VALUES (%1)").arg(values);
     124        QString query = QString("INSERT INTO EVENT (xid_conference, id, start, duration, xid_track, type, language, favourite, alarm) VALUES (%1)").arg(values);
    126125        QSqlQuery result (query, db);
    127126        //LOG_AUTOTEST(query);
     
    233232            timeslot_duration INTEGER)");
    234233
    235         query.exec("CREATE TABLE ACTIVITY ( \
     234        query.exec("CREATE TABLE TRACK ( \
    236235            id INTEGER  PRIMARY KEY AUTOINCREMENT  NOT NULL , \
    237236            name VARCHAR NOT NULL )");
     
    251250            start INTEGER NOT NULL , \
    252251            duration INTEGER NOT NULL , \
    253             xid_activity INTEGER NOT NULL REFERENCES ACTIVITY(id), \
     252            xid_track INTEGER NOT NULL REFERENCES TRACK(id), \
    254253            type VARCHAR, \
    255254            language VARCHAR, \
     
    258257            PRIMARY KEY (xid_conference,id), \
    259258            FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id) \
    260             FOREIGN KEY(xid_activity) REFERENCES ACTIVITY(id))");
     259            FOREIGN KEY(xid_track) REFERENCES TRACK(id))");
    261260
    262261#ifdef MAEMO
Note: See TracChangeset for help on using the changeset viewer.