feat(MainDb): enforce conference_event table, primary key is now (event_id, chat_room_id)

This commit is contained in:
Ronan Abhamon 2017-11-21 15:43:43 +01:00
parent 82f04ddb29
commit e3ff46be75

View file

@ -746,6 +746,7 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
" is_admin BOOLEAN NOT NULL,"
" PRIMARY KEY (chat_room_id, sip_address_id),"
" FOREIGN KEY (chat_room_id)"
" REFERENCES chat_room(id)"
" ON DELETE CASCADE,"
@ -756,10 +757,11 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
*session <<
"CREATE TABLE IF NOT EXISTS conference_event ("
" event_id" + primaryKeyStr("BIGINT UNSIGNED") + ","
" event_id" + primaryKeyRefStr("BIGINT UNSIGNED") + ","
" chat_room_id" + primaryKeyRefStr("BIGINT UNSIGNED") + ","
" PRIMARY KEY (event_id, chat_room_id),"
" FOREIGN KEY (event_id)"
" REFERENCES event(id)"
" ON DELETE CASCADE,"