Change data types according to sqlx

Co-authored-by: Elias Schriefer
This commit is contained in:
Erik Foris 2021-06-14 14:33:57 +00:00
parent 36cc3d4de6
commit ce83c99420
6 changed files with 10 additions and 10 deletions

View File

@ -1,7 +1,7 @@
-- external_servers_preferences definition -- external_servers_preferences definition
CREATE TABLE external_servers_preferences ( CREATE TABLE external_servers_preferences (
id INTEGER NOT NULL PRIMARY KEY, id BLOB NOT NULL PRIMARY KEY,
external_servers BLOB NOT NULL, external_servers BLOB NOT NULL,
external_servers_limit TEXT 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 CONSTRAINT external_servers_preferences_FK FOREIGN KEY (id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE

View File

@ -1,7 +1,7 @@
-- external_servers_privacy_preferences definition -- external_servers_privacy_preferences definition
CREATE TABLE external_servers_privacy_preferences ( CREATE TABLE external_servers_privacy_preferences (
id INTEGER NOT NULL PRIMARY KEY, id BLOB NOT NULL PRIMARY KEY,
discovery BLOB NOT NULL, discovery BLOB NOT NULL,
discovery_user_limit TEXT NOT NULL, discovery_user_limit TEXT NOT NULL,
discovery_server_limit TEXT NOT NULL, discovery_server_limit TEXT NOT NULL,

View File

@ -1,8 +1,8 @@
-- notification_preferences definition -- notification_preferences definition
CREATE TABLE notification_preferences ( CREATE TABLE notification_preferences (
id INTEGER NOT NULL PRIMARY KEY, id BLOB NOT NULL PRIMARY KEY,
lock_details INTEGER DEFAULT 0 NOT NULL, lock_details BOOLEAN DEFAULT 0 NOT NULL CHECK (lock_details IN (0, 1)),
do_not_disturb INTEGER DEFAULT 0 NOT NULL, do_not_disturb INTEGER DEFAULT 0 NOT NULL CHECK (do_not_disturb IN (0, 1)),
CONSTRAINT notification_preferences_FK FOREIGN KEY (id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE CONSTRAINT notification_preferences_FK FOREIGN KEY (id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE
); );

View File

@ -1,14 +1,14 @@
-- privacy_preferences definition -- privacy_preferences definition
CREATE TABLE privacy_preferences ( CREATE TABLE privacy_preferences (
id INTEGER NOT NULL PRIMARY KEY, id BLOB NOT NULL PRIMARY KEY,
discovery BLOB NOT NULL, discovery BLOB NOT NULL,
discovery_user_limit TEXT NOT NULL, discovery_user_limit TEXT NOT NULL,
discovery_server_limit TEXT NOT NULL, discovery_server_limit TEXT NOT NULL,
last_seen BLOB NOT NULL, last_seen BLOB NOT NULL,
last_seen_user_limit TEXT NOT NULL, last_seen_user_limit TEXT NOT NULL,
last_seen_server_limit TEXT NOT NULL, last_seen_server_limit TEXT NOT NULL,
last_seen_course INTEGER DEFAULT 0 NOT NULL, last_seen_course BOOLEAN DEFAULT 0 NOT NULL CHECK (last_seen_course IN (0, 1)),
info BLOB NOT NULL, info BLOB NOT NULL,
info_user_limit TEXT NOT NULL, info_user_limit TEXT NOT NULL,
info_server_limit TEXT NOT NULL, info_server_limit TEXT NOT NULL,

View File

@ -1,7 +1,7 @@
-- security_preferences definition -- security_preferences definition
CREATE TABLE "security_preferences" ( CREATE TABLE "security_preferences" (
id INTEGER NOT NULL PRIMARY KEY, id BLOB NOT NULL PRIMARY KEY,
account_tokens TEXT NOT NULL, account_tokens TEXT NOT NULL,
password_hash TEXT NOT NULL, password_hash TEXT NOT NULL,
CONSTRAINT NewTable_FK FOREIGN KEY (id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE CONSTRAINT NewTable_FK FOREIGN KEY (id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE

View File

@ -1,10 +1,10 @@
-- users definition -- users definition
CREATE TABLE users ( CREATE TABLE users (
id INTEGER NOT NULL PRIMARY KEY, id BLOB NOT NULL PRIMARY KEY,
user_name TEXT NOT NULL, user_name TEXT NOT NULL,
display_name TEXT, display_name TEXT,
activated INTEGER DEFAULT 0 NOT NULL, activated BOOLEAN DEFAULT 0 NOT NULL CHECK (activated IN (0, 1)),
created INTEGER NOT NULL, created INTEGER NOT NULL,
last_online INTEGER last_online INTEGER
); );