From 0a4d5fa6c64e087dee751e88d34ec2339d610285 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Tue, 23 Feb 2016 06:37:13 +0100 Subject: [PATCH] Fixed #164 partially. --- resources/misc/db_update_mysql_1_2.sql | 6 +- resources/misc/db_update_mysql_2_3.sql | 8 +- resources/misc/db_update_mysql_3_4.sql | 134 ++++++++-------- resources/misc/db_update_mysql_4_5.sql | 40 ++--- resources/misc/db_update_sqlite_1_2.sql | 6 +- resources/misc/db_update_sqlite_2_3.sql | 8 +- resources/misc/db_update_sqlite_3_4.sql | 204 ++++++++++++------------ resources/misc/db_update_sqlite_4_5.sql | 40 ++--- resources/text/CHANGELOG | 1 + src/gui/dialogs/formsettings.ui | 11 +- 10 files changed, 238 insertions(+), 220 deletions(-) diff --git a/resources/misc/db_update_mysql_1_2.sql b/resources/misc/db_update_mysql_1_2.sql index 76fd4d1fa..1df47a23d 100644 --- a/resources/misc/db_update_mysql_1_2.sql +++ b/resources/misc/db_update_mysql_1_2.sql @@ -1,4 +1,4 @@ -ALTER TABLE Messages -ADD COLUMN is_pdeleted INTEGER(1) NOT NULL DEFAULT 0 CHECK (is_pdeleted >= 0 AND is_pdeleted <= 1); --- ! +ALTER TABLE Messages +ADD COLUMN is_pdeleted INTEGER(1) NOT NULL DEFAULT 0 CHECK (is_pdeleted >= 0 AND is_pdeleted <= 1); +-- ! UPDATE Information SET inf_value = '2' WHERE inf_key = 'schema_version'; \ No newline at end of file diff --git a/resources/misc/db_update_mysql_2_3.sql b/resources/misc/db_update_mysql_2_3.sql index 3c6f614b7..326b083b8 100644 --- a/resources/misc/db_update_mysql_2_3.sql +++ b/resources/misc/db_update_mysql_2_3.sql @@ -1,4 +1,4 @@ -ALTER TABLE Messages -ADD COLUMN enclosures TEXT; --- ! -UPDATE Information SET inf_value = '3' WHERE inf_key = 'schema_version'; +ALTER TABLE Messages +ADD COLUMN enclosures TEXT; +-- ! +UPDATE Information SET inf_value = '3' WHERE inf_key = 'schema_version'; diff --git a/resources/misc/db_update_mysql_3_4.sql b/resources/misc/db_update_mysql_3_4.sql index f2c27f644..9dc74ab99 100644 --- a/resources/misc/db_update_mysql_3_4.sql +++ b/resources/misc/db_update_mysql_3_4.sql @@ -1,68 +1,68 @@ -CREATE TABLE Accounts ( - id INTEGER PRIMARY KEY, - type TEXT NOT NULL -); --- ! -INSERT INTO Accounts (type) VALUES ('std-rss'); --- ! -DROP TABLE IF EXISTS FeedsData; --- ! -CREATE TABLE 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, - - FOREIGN KEY (id) REFERENCES Accounts (id) -); --- ! -ALTER TABLE Messages -ADD COLUMN account_id INTEGER NOT NULL DEFAULT 1; --- ! -ALTER TABLE Messages -ADD COLUMN custom_id TEXT; --- ! -ALTER TABLE Messages -DROP FOREIGN KEY feed; --- ! -ALTER TABLE Messages -MODIFY feed TEXT NOT NULL; --- ! -ALTER TABLE Messages -MODIFY author TEXT; --- ! -ALTER TABLE Messages -MODIFY url TEXT; --- ! -ALTER TABLE Feeds -ADD COLUMN account_id INTEGER NOT NULL DEFAULT 1; --- ! -ALTER TABLE Feeds -ADD COLUMN custom_id TEXT; --- ! -ALTER TABLE Feeds -MODIFY date_created BIGINT; --- ! -ALTER TABLE Feeds -MODIFY encoding TEXT; --- ! -ALTER TABLE Feeds -MODIFY url VARCHAR(100); --- ! -ALTER TABLE Feeds -MODIFY type INTEGER; --- ! -ALTER TABLE Categories -ADD COLUMN account_id INTEGER NOT NULL DEFAULT 1; --- ! -ALTER TABLE Categories -ADD COLUMN custom_id TEXT; --- ! -ALTER TABLE Categories -MODIFY date_created BIGINT; --- ! +CREATE TABLE Accounts ( + id INTEGER PRIMARY KEY, + type TEXT NOT NULL +); +-- ! +INSERT INTO Accounts (type) VALUES ('std-rss'); +-- ! +DROP TABLE IF EXISTS FeedsData; +-- ! +CREATE TABLE 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, + + FOREIGN KEY (id) REFERENCES Accounts (id) +); +-- ! +ALTER TABLE Messages +ADD COLUMN account_id INTEGER NOT NULL DEFAULT 1; +-- ! +ALTER TABLE Messages +ADD COLUMN custom_id TEXT; +-- ! +ALTER TABLE Messages +DROP FOREIGN KEY feed; +-- ! +ALTER TABLE Messages +MODIFY feed TEXT NOT NULL; +-- ! +ALTER TABLE Messages +MODIFY author TEXT; +-- ! +ALTER TABLE Messages +MODIFY url TEXT; +-- ! +ALTER TABLE Feeds +ADD COLUMN account_id INTEGER NOT NULL DEFAULT 1; +-- ! +ALTER TABLE Feeds +ADD COLUMN custom_id TEXT; +-- ! +ALTER TABLE Feeds +MODIFY date_created BIGINT; +-- ! +ALTER TABLE Feeds +MODIFY encoding TEXT; +-- ! +ALTER TABLE Feeds +MODIFY url VARCHAR(100); +-- ! +ALTER TABLE Feeds +MODIFY type INTEGER; +-- ! +ALTER TABLE Categories +ADD COLUMN account_id INTEGER NOT NULL DEFAULT 1; +-- ! +ALTER TABLE Categories +ADD COLUMN custom_id TEXT; +-- ! +ALTER TABLE Categories +MODIFY date_created BIGINT; +-- ! UPDATE Information SET inf_value = '4' WHERE inf_key = 'schema_version'; \ No newline at end of file diff --git a/resources/misc/db_update_mysql_4_5.sql b/resources/misc/db_update_mysql_4_5.sql index 6b02c9e85..95c50bb4e 100755 --- a/resources/misc/db_update_mysql_4_5.sql +++ b/resources/misc/db_update_mysql_4_5.sql @@ -1,19 +1,23 @@ -CREATE TABLE IF NOT EXISTS OwnCloudAccounts ( - id INTEGER, - username TEXT NOT NULL, - password TEXT, - url TEXT NOT NULL, - force_update INTEGER(1) NOT NULL CHECK (force_update >= 0 AND force_update <= 1) DEFAULT 0, - - FOREIGN KEY (id) REFERENCES Accounts (id) -); --- ! -UPDATE Categories -SET custom_id = (SELECT id FROM Categories t WHERE t.id = Categories.id) -WHERE Categories.custom_id IS NULL; --- ! -UPDATE Feeds -SET custom_id = (SELECT id FROM Feeds t WHERE t.id = Feeds.id) -WHERE Feeds.custom_id IS NULL; --- ! +CREATE TABLE IF NOT EXISTS OwnCloudAccounts ( + id INTEGER, + username TEXT NOT NULL, + password TEXT, + url TEXT NOT NULL, + force_update INTEGER(1) NOT NULL CHECK (force_update >= 0 AND force_update <= 1) DEFAULT 0, + + FOREIGN KEY (id) REFERENCES Accounts (id) +); +-- ! +UPDATE Categories +SET custom_id = (SELECT id FROM Categories t WHERE t.id = Categories.id) +WHERE Categories.custom_id IS NULL; +-- ! +UPDATE Feeds +SET custom_id = (SELECT id FROM Feeds t WHERE t.id = Feeds.id) +WHERE Feeds.custom_id IS NULL; +-- ! +UPDATE Messages +SET custom_id = (SELECT id FROM Messages t WHERE t.id = Messages.id) +WHERE Messages.custom_id IS NULL; +-- ! UPDATE Information SET inf_value = '5' WHERE inf_key = 'schema_version'; \ No newline at end of file diff --git a/resources/misc/db_update_sqlite_1_2.sql b/resources/misc/db_update_sqlite_1_2.sql index 76fd4d1fa..1df47a23d 100644 --- a/resources/misc/db_update_sqlite_1_2.sql +++ b/resources/misc/db_update_sqlite_1_2.sql @@ -1,4 +1,4 @@ -ALTER TABLE Messages -ADD COLUMN is_pdeleted INTEGER(1) NOT NULL DEFAULT 0 CHECK (is_pdeleted >= 0 AND is_pdeleted <= 1); --- ! +ALTER TABLE Messages +ADD COLUMN is_pdeleted INTEGER(1) NOT NULL DEFAULT 0 CHECK (is_pdeleted >= 0 AND is_pdeleted <= 1); +-- ! UPDATE Information SET inf_value = '2' WHERE inf_key = 'schema_version'; \ No newline at end of file diff --git a/resources/misc/db_update_sqlite_2_3.sql b/resources/misc/db_update_sqlite_2_3.sql index 3c6f614b7..326b083b8 100644 --- a/resources/misc/db_update_sqlite_2_3.sql +++ b/resources/misc/db_update_sqlite_2_3.sql @@ -1,4 +1,4 @@ -ALTER TABLE Messages -ADD COLUMN enclosures TEXT; --- ! -UPDATE Information SET inf_value = '3' WHERE inf_key = 'schema_version'; +ALTER TABLE Messages +ADD COLUMN enclosures TEXT; +-- ! +UPDATE Information SET inf_value = '3' WHERE inf_key = 'schema_version'; diff --git a/resources/misc/db_update_sqlite_3_4.sql b/resources/misc/db_update_sqlite_3_4.sql index 7366f1b5e..d357313bb 100644 --- a/resources/misc/db_update_sqlite_3_4.sql +++ b/resources/misc/db_update_sqlite_3_4.sql @@ -1,103 +1,103 @@ -CREATE TABLE Accounts ( - id INTEGER PRIMARY KEY, - type TEXT NOT NULL -); --- ! -INSERT INTO Accounts (type) VALUES ('std-rss'); --- ! -DROP TABLE IF EXISTS FeedsData; --- ! -CREATE TABLE 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, - - FOREIGN KEY (id) REFERENCES Accounts (id) -); --- ! -CREATE TABLE backup_Messages AS SELECT * FROM Messages; --- ! -DROP TABLE Messages; --- ! -CREATE TABLE Messages ( - id INTEGER PRIMARY KEY, - is_read INTEGER(1) NOT NULL CHECK (is_read >= 0 AND is_read <= 1) DEFAULT 0, - is_deleted INTEGER(1) NOT NULL CHECK (is_deleted >= 0 AND is_deleted <= 1) DEFAULT 0, - is_important INTEGER(1) NOT NULL CHECK (is_important >= 0 AND is_important <= 1) DEFAULT 0, - feed TEXT NOT NULL, - title TEXT NOT NULL CHECK (title != ''), - url TEXT, - author TEXT, - date_created INTEGER NOT NULL CHECK (date_created != 0), - contents TEXT, - is_pdeleted INTEGER(1) NOT NULL CHECK (is_pdeleted >= 0 AND is_pdeleted <= 1) DEFAULT 0, - enclosures TEXT, - account_id INTEGER NOT NULL, - custom_id TEXT, - - FOREIGN KEY (account_id) REFERENCES Accounts (id) -); --- ! -INSERT INTO Messages (id, is_read, is_deleted, is_important, feed, title, url, author, date_created, contents, is_pdeleted, enclosures, account_id) -SELECT id, is_read, is_deleted, is_important, feed, title, url, author, date_created, contents, is_pdeleted, enclosures, 1 FROM backup_Messages; --- ! -DROP TABLE backup_Messages; --- ! -CREATE TABLE backup_Feeds AS SELECT * FROM Feeds; --- ! -DROP TABLE Feeds; --- ! -CREATE TABLE Feeds ( - id INTEGER PRIMARY KEY, - title TEXT NOT NULL CHECK (title != ''), - description TEXT, - date_created INTEGER, - icon BLOB, - category INTEGER NOT NULL CHECK (category >= -1), - encoding TEXT, - url TEXT, - protected INTEGER(1) NOT NULL CHECK (protected >= 0 AND protected <= 1), - username TEXT, - password TEXT, - update_type INTEGER(1) NOT NULL CHECK (update_type >= 0), - update_interval INTEGER NOT NULL CHECK (update_interval >= 5) DEFAULT 15, - type INTEGER, - account_id INTEGER NOT NULL, - custom_id TEXT, - - FOREIGN KEY (account_id) REFERENCES Accounts (id) -); --- ! -INSERT INTO Feeds (id, title, description, date_created, icon, category, encoding, url, protected, username, password, update_type, update_type, type, account_id) -SELECT id, title, description, date_created, icon, category, encoding, url, protected, username, password, update_type, update_type, type, 1 FROM backup_Feeds; --- ! -DROP TABLE backup_Feeds; --- ! -CREATE TABLE backup_Categories AS SELECT * FROM Categories; --- ! -DROP TABLE Categories; --- ! -CREATE TABLE Categories ( - id INTEGER PRIMARY KEY, - parent_id INTEGER NOT NULL, - title TEXT NOT NULL CHECK (title != ''), - description TEXT, - date_created INTEGER, - icon BLOB, - account_id INTEGER NOT NULL, - custom_id TEXT, - - FOREIGN KEY (account_id) REFERENCES Accounts (id) -); --- ! -INSERT INTO Categories (id, parent_id, title, description, date_created, icon, account_id) -SELECT id, parent_id, title, description, date_created, icon, 1 FROM backup_Categories; --- ! -DROP TABLE backup_Categories; --- ! +CREATE TABLE Accounts ( + id INTEGER PRIMARY KEY, + type TEXT NOT NULL +); +-- ! +INSERT INTO Accounts (type) VALUES ('std-rss'); +-- ! +DROP TABLE IF EXISTS FeedsData; +-- ! +CREATE TABLE 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, + + FOREIGN KEY (id) REFERENCES Accounts (id) +); +-- ! +CREATE TABLE backup_Messages AS SELECT * FROM Messages; +-- ! +DROP TABLE Messages; +-- ! +CREATE TABLE Messages ( + id INTEGER PRIMARY KEY, + is_read INTEGER(1) NOT NULL CHECK (is_read >= 0 AND is_read <= 1) DEFAULT 0, + is_deleted INTEGER(1) NOT NULL CHECK (is_deleted >= 0 AND is_deleted <= 1) DEFAULT 0, + is_important INTEGER(1) NOT NULL CHECK (is_important >= 0 AND is_important <= 1) DEFAULT 0, + feed TEXT NOT NULL, + title TEXT NOT NULL CHECK (title != ''), + url TEXT, + author TEXT, + date_created INTEGER NOT NULL CHECK (date_created != 0), + contents TEXT, + is_pdeleted INTEGER(1) NOT NULL CHECK (is_pdeleted >= 0 AND is_pdeleted <= 1) DEFAULT 0, + enclosures TEXT, + account_id INTEGER NOT NULL, + custom_id TEXT, + + FOREIGN KEY (account_id) REFERENCES Accounts (id) +); +-- ! +INSERT INTO Messages (id, is_read, is_deleted, is_important, feed, title, url, author, date_created, contents, is_pdeleted, enclosures, account_id) +SELECT id, is_read, is_deleted, is_important, feed, title, url, author, date_created, contents, is_pdeleted, enclosures, 1 FROM backup_Messages; +-- ! +DROP TABLE backup_Messages; +-- ! +CREATE TABLE backup_Feeds AS SELECT * FROM Feeds; +-- ! +DROP TABLE Feeds; +-- ! +CREATE TABLE Feeds ( + id INTEGER PRIMARY KEY, + title TEXT NOT NULL CHECK (title != ''), + description TEXT, + date_created INTEGER, + icon BLOB, + category INTEGER NOT NULL CHECK (category >= -1), + encoding TEXT, + url TEXT, + protected INTEGER(1) NOT NULL CHECK (protected >= 0 AND protected <= 1), + username TEXT, + password TEXT, + update_type INTEGER(1) NOT NULL CHECK (update_type >= 0), + update_interval INTEGER NOT NULL CHECK (update_interval >= 5) DEFAULT 15, + type INTEGER, + account_id INTEGER NOT NULL, + custom_id TEXT, + + FOREIGN KEY (account_id) REFERENCES Accounts (id) +); +-- ! +INSERT INTO Feeds (id, title, description, date_created, icon, category, encoding, url, protected, username, password, update_type, update_type, type, account_id) +SELECT id, title, description, date_created, icon, category, encoding, url, protected, username, password, update_type, update_type, type, 1 FROM backup_Feeds; +-- ! +DROP TABLE backup_Feeds; +-- ! +CREATE TABLE backup_Categories AS SELECT * FROM Categories; +-- ! +DROP TABLE Categories; +-- ! +CREATE TABLE Categories ( + id INTEGER PRIMARY KEY, + parent_id INTEGER NOT NULL, + title TEXT NOT NULL CHECK (title != ''), + description TEXT, + date_created INTEGER, + icon BLOB, + account_id INTEGER NOT NULL, + custom_id TEXT, + + FOREIGN KEY (account_id) REFERENCES Accounts (id) +); +-- ! +INSERT INTO Categories (id, parent_id, title, description, date_created, icon, account_id) +SELECT id, parent_id, title, description, date_created, icon, 1 FROM backup_Categories; +-- ! +DROP TABLE backup_Categories; +-- ! UPDATE Information SET inf_value = '4' WHERE inf_key = 'schema_version'; \ No newline at end of file diff --git a/resources/misc/db_update_sqlite_4_5.sql b/resources/misc/db_update_sqlite_4_5.sql index 6b02c9e85..95c50bb4e 100755 --- a/resources/misc/db_update_sqlite_4_5.sql +++ b/resources/misc/db_update_sqlite_4_5.sql @@ -1,19 +1,23 @@ -CREATE TABLE IF NOT EXISTS OwnCloudAccounts ( - id INTEGER, - username TEXT NOT NULL, - password TEXT, - url TEXT NOT NULL, - force_update INTEGER(1) NOT NULL CHECK (force_update >= 0 AND force_update <= 1) DEFAULT 0, - - FOREIGN KEY (id) REFERENCES Accounts (id) -); --- ! -UPDATE Categories -SET custom_id = (SELECT id FROM Categories t WHERE t.id = Categories.id) -WHERE Categories.custom_id IS NULL; --- ! -UPDATE Feeds -SET custom_id = (SELECT id FROM Feeds t WHERE t.id = Feeds.id) -WHERE Feeds.custom_id IS NULL; --- ! +CREATE TABLE IF NOT EXISTS OwnCloudAccounts ( + id INTEGER, + username TEXT NOT NULL, + password TEXT, + url TEXT NOT NULL, + force_update INTEGER(1) NOT NULL CHECK (force_update >= 0 AND force_update <= 1) DEFAULT 0, + + FOREIGN KEY (id) REFERENCES Accounts (id) +); +-- ! +UPDATE Categories +SET custom_id = (SELECT id FROM Categories t WHERE t.id = Categories.id) +WHERE Categories.custom_id IS NULL; +-- ! +UPDATE Feeds +SET custom_id = (SELECT id FROM Feeds t WHERE t.id = Feeds.id) +WHERE Feeds.custom_id IS NULL; +-- ! +UPDATE Messages +SET custom_id = (SELECT id FROM Messages t WHERE t.id = Messages.id) +WHERE Messages.custom_id IS NULL; +-- ! UPDATE Information SET inf_value = '5' WHERE inf_key = 'schema_version'; \ No newline at end of file diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG index 4a61e7f46..62d9eb98d 100755 --- a/resources/text/CHANGELOG +++ b/resources/text/CHANGELOG @@ -15,6 +15,7 @@ Added: Fixed: +▪ Some other minor fixes. ▪ Feed list hidden when respective menu item is unchecked. (bug #163) ▪ Standard RSS/RDF/ATOM relative URLs in entries should now be correctly loaded. (bug #160) ▪ Fixed some problems when adding feeds from external web browser like Firefox. (bug #135) diff --git a/src/gui/dialogs/formsettings.ui b/src/gui/dialogs/formsettings.ui index 4ce276223..36c0f0db3 100755 --- a/src/gui/dialogs/formsettings.ui +++ b/src/gui/dialogs/formsettings.ui @@ -1342,7 +1342,7 @@ Authors of this application are NOT responsible for lost data. - 0 + 1 @@ -1511,9 +1511,18 @@ Authors of this application are NOT responsible for lost data. + + + 0 + 0 + + false + + QComboBox::AdjustToContents +