Change sql query to check 'IF' table ' NOT EXISTS'

This commit is contained in:
Erik Foris 2021-07-13 15:32:45 +00:00
parent aa021a9754
commit 95d15f7a9d
6 changed files with 6 additions and 6 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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)),

View File

@ -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,

View File

@ -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,

View File

@ -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,