Added enclosures column for DB layer.

This commit is contained in:
Martin Rotter 2015-04-06 19:23:43 +02:00
parent d88bce20cf
commit 4656a43cfb
6 changed files with 15 additions and 4 deletions

View File

@ -63,6 +63,7 @@ CREATE TABLE IF NOT EXISTS Messages (
date_created INTEGER NOT NULL CHECK (date_created != 0),
contents TEXT,
is_pdeleted INTEGER(1) NOT NULL DEFAULT 0 CHECK (is_pdeleted >= 0 AND is_pdeleted <= 1),
enclosures TEXT,
FOREIGN KEY (feed) REFERENCES Feeds (id)
);
@ -77,4 +78,4 @@ INSERT INTO Feeds (title, description, date_created, category, encoding, url, pr
-- !
INSERT INTO Feeds (title, description, date_created, category, encoding, url, protected, update_type, type) VALUES ('LXer: Linux News', 'The world is talking about GNU/Linux and Free/Open Source Software.', 1388678961000, 1, 'UTF-8', 'http://lxer.com/module/newswire/headlines.rss', 0, 1, 2);
-- !
INSERT INTO Feeds (title, description, date_created, category, encoding, url, protected, update_type, update_interval, type) VALUES ('Recent Commits', 'Recent commits for RSS Guard project.', 1388678961000, 2, 'UTF-8', 'http://bitbucket.org/skunkos/rssguard/rss', 0, 2, 30, 1);
INSERT INTO Feeds (title, description, date_created, category, encoding, url, protected, update_type, update_interval, type) VALUES ('Recent Commits', 'Recent commits for RSS Guard project.', 1388678961000, 2, 'UTF-8', 'http://bitbucket.org/skunkos/rssguard/rss', 0, 2, 30, 1);

View File

@ -63,6 +63,7 @@ CREATE TABLE IF NOT EXISTS Messages (
date_created INTEGER NOT NULL CHECK (date_created != 0),
contents TEXT,
is_pdeleted INTEGER(1) NOT NULL DEFAULT 0 CHECK (is_pdeleted >= 0 AND is_pdeleted <= 1),
enclosures TEXT,
FOREIGN KEY (feed) REFERENCES Feeds (id)
);
);

View File

@ -0,0 +1,4 @@
ALTER TABLE Messages
ADD COLUMN enclosures TEXT;
-- !
UPDATE Information SET inf_value = '3' WHERE inf_key = 'schema_version';

View File

@ -0,0 +1,4 @@
ALTER TABLE Messages
ADD COLUMN enclosures TEXT;
-- !
UPDATE Information SET inf_value = '3' WHERE inf_key = 'schema_version';

View File

@ -146,7 +146,8 @@ void MessagesModel::setupHeaderData() {
/*: Tooltip for author of message.*/ tr("Author") <<
/*: Tooltip for creation date of message.*/ tr("Created on") <<
/*: Tooltip for contents of message.*/ tr("Contents") <<
/*: Tooltip for "pdeleted" column in msg list.*/ tr("Permanently deleted");
/*: Tooltip for "pdeleted" column in msg list.*/ tr("Permanently deleted") <<
/*: Tooltip for attachments of message.*/ tr("Attachments");
m_tooltipData << tr("Id of the message.") << tr("Is message read?") <<
tr("Is message deleted?") << tr("Is message important?") <<

View File

@ -100,7 +100,7 @@
#define APP_DB_SQLITE_FILE "database.db"
// Keep this in sync with schema versions declared in SQL initialization code.
#define APP_DB_SCHEMA_VERSION "2"
#define APP_DB_SCHEMA_VERSION "3"
#define APP_DB_UPDATE_FILE_PATTERN "db_update_%1_%2_%3.sql"
#define APP_DB_COMMENT_SPLIT "-- !\n"
#define APP_DB_WEB_PATH "data/database/web"