Commit 648119fd authored by Ronan's avatar Ronan

fix(EventsDb): avoid duplication in db

parent b83fe641
......@@ -135,13 +135,13 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
*session <<
"CREATE TABLE IF NOT EXISTS sip_address ("
" id" + primaryKeyAutoIncrementStr() + ","
" value VARCHAR(255) NOT NULL"
" value VARCHAR(255) UNIQUE NOT NULL"
")";
*session <<
"CREATE TABLE IF NOT EXISTS event_type ("
" id TINYINT UNSIGNED,"
" value VARCHAR(255) NOT NULL"
" value VARCHAR(255) UNIQUE NOT NULL"
")";
*session <<
......@@ -157,13 +157,13 @@ EventsDb::EventsDb () : AbstractDb(*new EventsDbPrivate) {}
*session <<
"CREATE TABLE IF NOT EXISTS message_state ("
" id TINYINT UNSIGNED,"
" value VARCHAR(255) NOT NULL"
" value VARCHAR(255) UNIQUE NOT NULL"
")";
*session <<
"CREATE TABLE IF NOT EXISTS message_direction ("
" id TINYINT UNSIGNED,"
" value VARCHAR(255) NOT NULL"
" value VARCHAR(255) UNIQUE NOT NULL"
")";
*session <<
......
No preview for this file type
......@@ -37,7 +37,7 @@ static const string getDatabasePath () {
static void open_database () {
EventsDb eventsDb;
eventsDb.connect(EventsDb::Sqlite3, getDatabasePath());
BC_ASSERT_TRUE(eventsDb.connect(EventsDb::Sqlite3, getDatabasePath()));
}
test_t events_db_tests[] = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment