From 5e7e4567322f2005c5aeacff9e96cb73a0be48d7 Mon Sep 17 00:00:00 2001 From: EliasSchriefer Date: Tue, 8 Jun 2021 11:22:57 +0000 Subject: [PATCH] Modify database layout --- sqlite/external_servers_preferences.sql | 2 +- sqlite/external_servers_privacy_preferences.sql | 2 +- sqlite/notification_preferences.sql | 2 +- sqlite/privacy_preferences.sql | 2 +- sqlite/security_preferences.sql | 2 +- sqlite/users.sql | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sqlite/external_servers_preferences.sql b/sqlite/external_servers_preferences.sql index 922ec40..83944f5 100644 --- a/sqlite/external_servers_preferences.sql +++ b/sqlite/external_servers_preferences.sql @@ -1,7 +1,7 @@ -- external_servers_preferences definition CREATE TABLE external_servers_preferences ( - id INTEGER NOT NULL, + id INTEGER NOT NULL PRIMARY KEY, external_servers BLOB NOT NULL, external_servers_limit TEXT NOT NULL, CONSTRAINT external_servers_preferences_FK FOREIGN KEY (id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE diff --git a/sqlite/external_servers_privacy_preferences.sql b/sqlite/external_servers_privacy_preferences.sql index 9d6b558..9ea5a44 100644 --- a/sqlite/external_servers_privacy_preferences.sql +++ b/sqlite/external_servers_privacy_preferences.sql @@ -1,7 +1,7 @@ -- external_servers_privacy_preferences definition CREATE TABLE external_servers_privacy_preferences ( - id INTEGER NOT NULL, + id INTEGER NOT NULL PRIMARY KEY, discovery BLOB NOT NULL, discovery_user_limit TEXT NOT NULL, discovery_server_limit TEXT NOT NULL, diff --git a/sqlite/notification_preferences.sql b/sqlite/notification_preferences.sql index 766489e..36ab5d7 100644 --- a/sqlite/notification_preferences.sql +++ b/sqlite/notification_preferences.sql @@ -1,7 +1,7 @@ -- notification_preferences definition CREATE TABLE notification_preferences ( - id INTEGER NOT NULL, + id INTEGER NOT NULL PRIMARY KEY, lock_details INTEGER DEFAULT 0 NOT NULL, do_not_disturb INTEGER DEFAULT 0 NOT NULL, CONSTRAINT notification_preferences_FK FOREIGN KEY (id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE diff --git a/sqlite/privacy_preferences.sql b/sqlite/privacy_preferences.sql index 6e65bf1..28cfd21 100644 --- a/sqlite/privacy_preferences.sql +++ b/sqlite/privacy_preferences.sql @@ -1,7 +1,7 @@ -- privacy_preferences definition CREATE TABLE privacy_preferences ( - id INTEGER NOT NULL, + id INTEGER NOT NULL PRIMARY KEY, discovery BLOB NOT NULL, discovery_user_limit TEXT NOT NULL, discovery_server_limit TEXT NOT NULL, diff --git a/sqlite/security_preferences.sql b/sqlite/security_preferences.sql index 965d0f3..9ce04a5 100644 --- a/sqlite/security_preferences.sql +++ b/sqlite/security_preferences.sql @@ -1,7 +1,7 @@ -- security_preferences definition CREATE TABLE "security_preferences" ( - id INTEGER NOT NULL, + id INTEGER NOT NULL PRIMARY KEY, account_tokens TEXT NOT NULL, password_hash TEXT NOT NULL, CONSTRAINT NewTable_FK FOREIGN KEY (id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE diff --git a/sqlite/users.sql b/sqlite/users.sql index 121e75a..4dfc8c6 100644 --- a/sqlite/users.sql +++ b/sqlite/users.sql @@ -1,7 +1,7 @@ -- users definition CREATE TABLE users ( - id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + id INTEGER NOT NULL PRIMARY KEY, user_name TEXT NOT NULL, display_name TEXT, activated INTEGER DEFAULT 0 NOT NULL,