diff --git a/src/db/events-db.cpp b/src/db/events-db.cpp index 044561015..6787a060e 100644 --- a/src/db/events-db.cpp +++ b/src/db/events-db.cpp @@ -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 << diff --git a/tester/db/linphone.db b/tester/db/linphone.db index 607cb323e..8d5c4e69e 100644 Binary files a/tester/db/linphone.db and b/tester/db/linphone.db differ diff --git a/tester/events-db-tester.cpp b/tester/events-db-tester.cpp index 9f38bb738..bf110400f 100644 --- a/tester/events-db-tester.cpp +++ b/tester/events-db-tester.cpp @@ -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[] = {