From 937047a1d03d6f3d57eb945e249b35246c6ae9c8 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Wed, 3 Jun 2020 11:50:28 +0200 Subject: [PATCH] Forgotten files. --- resources/sql/db_update_mysql_12_13.sql | 4 ++++ resources/sql/db_update_sqlite_12_13.sql | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 resources/sql/db_update_mysql_12_13.sql create mode 100755 resources/sql/db_update_sqlite_12_13.sql diff --git a/resources/sql/db_update_mysql_12_13.sql b/resources/sql/db_update_mysql_12_13.sql new file mode 100755 index 000000000..ec44aca6d --- /dev/null +++ b/resources/sql/db_update_mysql_12_13.sql @@ -0,0 +1,4 @@ +ALTER TABLE TtRssAccounts +ADD COLUMN update_only_unread INTEGER(1) NOT NULL DEFAULT 0 CHECK (update_only_unread >= 0 AND update_only_unread <= 1); +-- ! +UPDATE Information SET inf_value = '13' WHERE inf_key = 'schema_version'; \ No newline at end of file diff --git a/resources/sql/db_update_sqlite_12_13.sql b/resources/sql/db_update_sqlite_12_13.sql new file mode 100755 index 000000000..c896ae79e --- /dev/null +++ b/resources/sql/db_update_sqlite_12_13.sql @@ -0,0 +1,24 @@ +CREATE TABLE backup_ta AS SELECT * FROM TtRssAccounts; +-- ! +DROP TABLE TtRssAccounts; +-- ! +CREATE TABLE IF NOT EXISTS TtRssAccounts ( + id INTEGER, + username TEXT NOT NULL, + password TEXT, + auth_protected INTEGER(1) NOT NULL CHECK (auth_protected >= 0 AND auth_protected <= 1) DEFAULT 0, + auth_username TEXT, + auth_password TEXT, + url TEXT NOT NULL, + force_update INTEGER(1) NOT NULL CHECK (force_update >= 0 AND force_update <= 1) DEFAULT 0, + update_only_unread INTEGER(1) NOT NULL CHECK (update_only_unread >= 0 AND update_only_unread <= 1) DEFAULT 0, + + FOREIGN KEY (id) REFERENCES Accounts (id) +); +-- ! +INSERT INTO TtRssAccounts (id, username, password, auth_protected, auth_username, auth_password, url, force_update, update_only_unread) +SELECT id, username, password, auth_protected, auth_username, auth_password, url, force_update, 0 FROM backup_ta; +-- ! +DROP TABLE backup_ta; +-- ! +UPDATE Information SET inf_value = '13' WHERE inf_key = 'schema_version'; \ No newline at end of file