mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-22 05:38:14 +00:00
feat(MainDb): enforce chat_room table, add unique and not null constraints on peer/local ids
This commit is contained in:
parent
8c7241bb13
commit
82f04ddb29
1 changed files with 5 additions and 3 deletions
|
|
@ -710,9 +710,9 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
|
|||
" id" + primaryKeyStr("BIGINT UNSIGNED") + ","
|
||||
|
||||
// Server (for conference) or user sip address.
|
||||
" peer_sip_address_id" + primaryKeyRefStr("BIGINT UNSIGNED") + ","
|
||||
" peer_sip_address_id" + primaryKeyRefStr("BIGINT UNSIGNED") + " NOT NULL,"
|
||||
|
||||
" local_sip_address_id" + primaryKeyRefStr("BIGINT UNSIGNED") + ","
|
||||
" local_sip_address_id" + primaryKeyRefStr("BIGINT UNSIGNED") + " NOT NULL,"
|
||||
|
||||
// Dialog creation date.
|
||||
" creation_date DATE NOT NULL,"
|
||||
|
|
@ -721,13 +721,15 @@ MainDb::MainDb (const shared_ptr<Core> &core) : AbstractDb(*new MainDbPrivate),
|
|||
" last_update_date DATE NOT NULL,"
|
||||
|
||||
// ConferenceChatRoom, BasicChatRoom, RTT...
|
||||
" capabilities TINYINT UNSIGNED,"
|
||||
" capabilities TINYINT UNSIGNED NOT NULL,"
|
||||
|
||||
// Chatroom subject.
|
||||
" subject VARCHAR(255),"
|
||||
|
||||
" last_notify_id INT UNSIGNED,"
|
||||
|
||||
" UNIQUE (peer_sip_address_id, local_sip_address_id),"
|
||||
|
||||
" FOREIGN KEY (peer_sip_address_id)"
|
||||
" REFERENCES sip_address(id)"
|
||||
" ON DELETE CASCADE,"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue