Custom ID converted to string, added as property to Message class.

This commit is contained in:
Martin Rotter 2015-12-03 13:42:50 +01:00
parent ff67c86517
commit 10f1841b54
6 changed files with 14 additions and 13 deletions

View File

@ -39,7 +39,7 @@ CREATE TABLE IF NOT EXISTS Categories (
date_created BIGINT NOT NULL CHECK (date_created != 0),
icon BLOB,
account_id INTEGER NOT NULL,
custom_id INTEGER,
custom_id TEXT,
FOREIGN KEY (account_id) REFERENCES Accounts (id)
);
@ -62,7 +62,7 @@ CREATE TABLE IF NOT EXISTS Feeds (
update_interval INTEGER NOT NULL DEFAULT 15 CHECK (update_interval >= 5),
type INTEGER NOT NULL CHECK (type >= 0),
account_id INTEGER NOT NULL,
custom_id INTEGER,
custom_id TEXT,
FOREIGN KEY (account_id) REFERENCES Accounts (id)
);
@ -83,7 +83,7 @@ CREATE TABLE IF NOT EXISTS Messages (
is_pdeleted INTEGER(1) NOT NULL DEFAULT 0 CHECK (is_pdeleted >= 0 AND is_pdeleted <= 1),
enclosures TEXT,
account_id INTEGER NOT NULL,
custom_id INTEGER,
custom_id TEXT,
FOREIGN KEY (feed) REFERENCES Feeds (id),
FOREIGN KEY (account_id) REFERENCES Accounts (id)

View File

@ -34,7 +34,7 @@ CREATE TABLE IF NOT EXISTS Categories (
date_created INTEGER NOT NULL CHECK (date_created != 0),
icon BLOB,
account_id INTEGER NOT NULL,
custom_id INTEGER,
custom_id TEXT,
FOREIGN KEY (account_id) REFERENCES Accounts (id)
);
@ -57,7 +57,7 @@ CREATE TABLE IF NOT EXISTS Feeds (
update_interval INTEGER NOT NULL CHECK (update_interval >= 5) DEFAULT 15,
type INTEGER NOT NULL CHECK (type >= 0),
account_id INTEGER NOT NULL,
custom_id INTEGER,
custom_id TEXT,
FOREIGN KEY (account_id) REFERENCES Accounts (id)
);
@ -78,7 +78,7 @@ CREATE TABLE IF NOT EXISTS Messages (
is_pdeleted INTEGER(1) NOT NULL DEFAULT 0 CHECK (is_pdeleted >= 0 AND is_pdeleted <= 1),
enclosures TEXT,
account_id INTEGER NOT NULL,
custom_id INTEGER,
custom_id TEXT,
FOREIGN KEY (feed) REFERENCES Feeds (id),
FOREIGN KEY (account_id) REFERENCES Accounts (id)

View File

@ -26,12 +26,12 @@ ALTER TABLE Categories
ADD COLUMN account_id INTEGER NOT NULL DEFAULT (1);
-- !
ALTER TABLE Messages
ADD COLUMN custom_id INTEGER;
ADD COLUMN custom_id TEXT;
-- !
ALTER TABLE Feeds
ADD COLUMN custom_id INTEGER;
ADD COLUMN custom_id TEXT;
-- !
ALTER TABLE Categories
ADD COLUMN custom_id INTEGER;
ADD COLUMN custom_id TEXT;
-- !
UPDATE Information SET inf_value = '4' WHERE inf_key = 'schema_version';

View File

@ -26,12 +26,12 @@ ALTER TABLE Categories
ADD COLUMN account_id INTEGER NOT NULL DEFAULT (1);
-- !
ALTER TABLE Messages
ADD COLUMN custom_id INTEGER;
ADD COLUMN custom_id TEXT;
-- !
ALTER TABLE Feeds
ADD COLUMN custom_id INTEGER;
ADD COLUMN custom_id TEXT;
-- !
ALTER TABLE Categories
ADD COLUMN custom_id INTEGER;
ADD COLUMN custom_id TEXT;
-- !
UPDATE Information SET inf_value = '4' WHERE inf_key = 'schema_version';

View File

@ -61,7 +61,7 @@ QString Enclosures::encodeEnclosuresToString(const QList<Enclosure> &enclosures)
}
Message::Message() {
m_title = m_url = m_author = m_contents = "";
m_title = m_url = m_author = m_contents = m_customId = "";
m_feedId = 0;
m_enclosures = QList<Enclosure>();
}

View File

@ -51,6 +51,7 @@ class Message {
QDateTime m_created;
int m_feedId;
QList<Enclosure> m_enclosures;
// Is true if "created" date was obtained directly