From 95d15f7a9ddf3c938bf0d9255cf157535555aa6f Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 13 Jul 2021 15:32:45 +0000 Subject: [PATCH] Change sql query to check 'IF' table ' NOT EXISTS' --- src/sqlite/external_servers_preferences.sql | 2 +- src/sqlite/external_servers_privacy_preferences.sql | 2 +- src/sqlite/notification_preferences.sql | 2 +- src/sqlite/privacy_preferences.sql | 2 +- src/sqlite/security_preferences.sql | 2 +- src/sqlite/users.sql | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/sqlite/external_servers_preferences.sql b/src/sqlite/external_servers_preferences.sql index 00b72e4..cdc1c5e 100644 --- a/src/sqlite/external_servers_preferences.sql +++ b/src/sqlite/external_servers_preferences.sql @@ -1,6 +1,6 @@ -- external_servers_preferences definition -CREATE TABLE external_servers_preferences ( +CREATE TABLE IF NOT EXISTS external_servers_preferences ( id BLOB NOT NULL PRIMARY KEY, external_servers BLOB NOT NULL, external_servers_limit TEXT NOT NULL, diff --git a/src/sqlite/external_servers_privacy_preferences.sql b/src/sqlite/external_servers_privacy_preferences.sql index 43c530c..d3565c5 100644 --- a/src/sqlite/external_servers_privacy_preferences.sql +++ b/src/sqlite/external_servers_privacy_preferences.sql @@ -1,6 +1,6 @@ -- external_servers_privacy_preferences definition -CREATE TABLE external_servers_privacy_preferences ( +CREATE TABLE IF NOT EXISTS external_servers_privacy_preferences ( id BLOB NOT NULL PRIMARY KEY, discovery BLOB NOT NULL, discovery_user_limit TEXT NOT NULL, diff --git a/src/sqlite/notification_preferences.sql b/src/sqlite/notification_preferences.sql index 953f50c..89f0679 100644 --- a/src/sqlite/notification_preferences.sql +++ b/src/sqlite/notification_preferences.sql @@ -1,6 +1,6 @@ -- notification_preferences definition -CREATE TABLE notification_preferences ( +CREATE TABLE IF NOT EXISTS notification_preferences ( id BLOB NOT NULL PRIMARY KEY, lock_details BOOLEAN DEFAULT 0 NOT NULL CHECK (lock_details IN (0, 1)), do_not_disturb BOOLEAN DEFAULT 0 NOT NULL CHECK (do_not_disturb IN (0, 1)), diff --git a/src/sqlite/privacy_preferences.sql b/src/sqlite/privacy_preferences.sql index 445bf03..6444d6f 100644 --- a/src/sqlite/privacy_preferences.sql +++ b/src/sqlite/privacy_preferences.sql @@ -1,6 +1,6 @@ -- privacy_preferences definition -CREATE TABLE privacy_preferences ( +CREATE TABLE IF NOT EXISTS privacy_preferences ( id BLOB NOT NULL PRIMARY KEY, discovery BLOB NOT NULL, discovery_user_limit TEXT NOT NULL, diff --git a/src/sqlite/security_preferences.sql b/src/sqlite/security_preferences.sql index 50ce979..5fcd6d4 100644 --- a/src/sqlite/security_preferences.sql +++ b/src/sqlite/security_preferences.sql @@ -1,6 +1,6 @@ -- security_preferences definition -CREATE TABLE "security_preferences" ( +CREATE TABLE IF NOT EXISTS "security_preferences" ( id BLOB NOT NULL PRIMARY KEY, account_tokens TEXT NOT NULL, password_hash TEXT NOT NULL, diff --git a/src/sqlite/users.sql b/src/sqlite/users.sql index 66500e7..f8cb143 100644 --- a/src/sqlite/users.sql +++ b/src/sqlite/users.sql @@ -1,6 +1,6 @@ -- users definition -CREATE TABLE users ( +CREATE TABLE IF NOT EXISTS users ( id BLOB NOT NULL PRIMARY KEY, user_name TEXT NOT NULL, display_name TEXT,