core: add host_conn_custom_user_profile_id to groups to replace join with connections causing duplicates (avoids complex subqueries) (#965)

This commit is contained in:
JRoberts
2022-08-22 23:12:09 +04:00
committed by GitHub
parent 6d1414af71
commit a06499d710
4 changed files with 26 additions and 22 deletions
+2 -1
View File
@@ -121,7 +121,8 @@ CREATE TABLE groups(
created_at TEXT CHECK(created_at NOT NULL),
updated_at TEXT CHECK(updated_at NOT NULL),
chat_item_id INTEGER DEFAULT NULL REFERENCES chat_items ON DELETE SET NULL,
enable_ntfs INTEGER, -- received
enable_ntfs INTEGER,
host_conn_custom_user_profile_id INTEGER REFERENCES contact_profiles ON DELETE SET NULL, -- received
FOREIGN KEY(user_id, local_display_name)
REFERENCES display_names(user_id, local_display_name)
ON DELETE CASCADE