#include <QDateTime>
#include <QDir>
-#include <appsettings.h>
#include "sqlengine.h"
#include <track.h>
#include <conference.h>
.arg(aConference["days"]) \
.arg(-QTime::fromString(aConference["day_change"],TIME_FORMAT).secsTo(QTime(0,0))) \
.arg(-QTime::fromString(aConference["timeslot_duration"],TIME_FORMAT).secsTo(QTime(0,0)));
+ values.append(QString(", '%1'").arg(confsList.count()>0?"0":"1"));
- QString query = QString("INSERT INTO CONFERENCE (title,subtitle,venue,city,start,end,days,day_change,timeslot_duration) VALUES (%1)").arg(values);
+ QString query = QString("INSERT INTO CONFERENCE (title,subtitle,venue,city,start,end,days,day_change,timeslot_duration,active) VALUES (%1)").arg(values);
QSqlQuery result (query, db);
aConference["id"] = result.lastInsertId().toString(); // 'id' is assigned automatically
-
- if(!AppSettings::confId()) // default conf Id isn't set yet => set it up
- AppSettings::setConfId(confId);
}
}
}
"end INTEGER NOT NULL, "
"days INTEGER, "
"day_change INTEGER, "
- "timeslot_duration INTEGER);");
+ "timeslot_duration INTEGER, "
+ "active INTEGER DEFAULT 0);");
query.exec("CREATE TABLE TRACK ( "
"id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "
"FOREIGN KEY(xid_event) REFERENCES EVENT(id), "
"FOREIGN KEY(xid_room) REFERENCES ROOM(id));");
+ query.exec("CREATE TABLE EVENT_CONFLICT ( "
+ "xid_conference INTEGER NOT NULL, "
+ "xid_event INTEGER NOT NULL, "
+ "conflict_event INTEGER NOT NULL, "
+ "UNIQUE ( xid_conference, xid_event, conflict_event ) ON CONFLICT IGNORE, "
+ "FOREIGN KEY(xid_conference) REFERENCES CONFERENCE(id), "
+ "FOREIGN KEY(xid_event) REFERENCES EVENT(id));");
+
query.exec("CREATE TABLE LINK ( "
"id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "
"xid_conference INTEGER NOT NULL, "
return true;
}
}
+