SQL structures for #334, fix for situation where RSS Guard wasnt starting.

This commit is contained in:
Martin Rotter 2021-01-21 08:24:32 +01:00
parent 730b569ba0
commit 20e16152aa
10 changed files with 62 additions and 13 deletions

View File

@ -30,7 +30,7 @@
<url type="donation">https://martinrotter.github.io/donate/</url>
<content_rating type="oars-1.1" />
<releases>
<release version="3.8.4" date="2021-01-20"/>
<release version="3.8.4" date="2021-01-21"/>
</releases>
<content_rating type="oars-1.0">
<content_attribute id="violence-cartoon">none</content_attribute>

@ -1 +1 @@
Subproject commit 9c10723bfbaf6cb85107d6ee16e0324e9e487749
Subproject commit 47f4125753452eff8800dbd6600c5a05540b15d9

View File

@ -17,6 +17,7 @@
<file>sql/db_update_mysql_14_15.sql</file>
<file>sql/db_update_mysql_15_16.sql</file>
<file>sql/db_update_mysql_16_17.sql</file>
<file>sql/db_update_mysql_17_18.sql</file>
<file>sql/db_init_sqlite.sql</file>
<file>sql/db_update_sqlite_1_2.sql</file>
@ -35,5 +36,6 @@
<file>sql/db_update_sqlite_14_15.sql</file>
<file>sql/db_update_sqlite_15_16.sql</file>
<file>sql/db_update_sqlite_16_17.sql</file>
<file>sql/db_update_sqlite_17_18.sql</file>
</qresource>
</RCC>

View File

@ -12,11 +12,16 @@ CREATE TABLE IF NOT EXISTS Information (
inf_value TEXT NOT NULL
);
-- !
INSERT INTO Information VALUES (1, 'schema_version', '17');
INSERT INTO Information VALUES (1, 'schema_version', '18');
-- !
CREATE TABLE IF NOT EXISTS Accounts (
id INTEGER PRIMARY KEY,
type TEXT NOT NULL
id INTEGER AUTO_INCREMENT PRIMARY KEY,
type TEXT NOT NULL CHECK (type != ''),
proxy_type INTEGER NOT NULL DEFAULT 0 CHECK (proxy_type >= 0),
proxy_host TEXT,
proxy_port INTEGER,
proxy_username TEXT,
proxy_password TEXT
);
-- !
CREATE TABLE IF NOT EXISTS TtRssAccounts (

View File

@ -6,11 +6,16 @@ CREATE TABLE IF NOT EXISTS Information (
inf_value TEXT NOT NULL
);
-- !
INSERT INTO Information VALUES (1, 'schema_version', '17');
INSERT INTO Information VALUES (1, 'schema_version', '18');
-- !
CREATE TABLE IF NOT EXISTS Accounts (
id INTEGER PRIMARY KEY,
type TEXT NOT NULL
type TEXT NOT NULL CHECK (type != ''),
proxy_type INTEGER NOT NULL CHECK (proxy_type >= 0) DEFAULT 0,
proxy_host TEXT,
proxy_port INTEGER,
proxy_username TEXT,
proxy_password TEXT
);
-- !
CREATE TABLE IF NOT EXISTS TtRssAccounts (

View File

@ -0,0 +1,13 @@
USE ##;
-- !
ALTER TABLE Accounts ADD COLUMN proxy_type INTEGER NOT NULL DEFAULT 0 CHECK (proxy_type >= 0);
-- !
ALTER TABLE Accounts ADD COLUMN proxy_host TEXT;
-- !
ALTER TABLE Accounts ADD COLUMN proxy_port INTEGER;
-- !
ALTER TABLE Accounts ADD COLUMN proxy_username TEXT;
-- !
ALTER TABLE Accounts ADD COLUMN proxy_password TEXT;
-- !
UPDATE Information SET inf_value = '18' WHERE inf_key = 'schema_version';

View File

@ -0,0 +1,23 @@
CREATE TABLE backup_acc AS SELECT * FROM Accounts;
-- !
PRAGMA foreign_keys = OFF;
-- !
DROP TABLE Accounts;
-- !
CREATE TABLE IF NOT EXISTS Accounts (
id INTEGER PRIMARY KEY,
type TEXT NOT NULL CHECK (type != ''),
proxy_type INTEGER NOT NULL CHECK (proxy_type >= 0) DEFAULT 0,
proxy_host TEXT,
proxy_port INTEGER,
proxy_username TEXT,
proxy_password TEXT
);
-- !
INSERT INTO Accounts (id, type) SELECT id, type FROM backup_acc;
-- !
DROP TABLE backup_acc;
-- !
PRAGMA foreign_keys = ON;
-- !
UPDATE Information SET inf_value = '18' WHERE inf_key = 'schema_version';

View File

@ -144,7 +144,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 "17"
#define APP_DB_SCHEMA_VERSION "18"
#define APP_DB_UPDATE_FILE_PATTERN "db_update_%1_%2_%3.sql"
#define APP_DB_COMMENT_SPLIT "-- !\n"
#define APP_DB_NAME_PLACEHOLDER "##"

View File

@ -77,10 +77,10 @@ void IconFactory::loadCurrentIconTheme() {
}
// Display list of installed themes.
qDebugNN << LOGSEC_GUI << "Installed icon themes are: %s.",
qPrintable(QStringList(installed_themes)
.replaceInStrings(QRegularExpression(QSL("^|$")), QSL("\'"))
.replaceInStrings(QRegularExpression(QSL("^\\'$")), QSL("\'\'")).join(QSL(", ")));
qDebugNN << LOGSEC_GUI << "Installed icon themes are: "
<< QStringList(installed_themes)
.replaceInStrings(QRegularExpression(QSL("^|$")), QSL("\'"))
.replaceInStrings(QRegularExpression(QSL("^\\'$")), QSL("\'\'")).join(QSL(", "));
if (installed_themes.contains(theme_name_from_settings)) {
// Desired icon theme is installed and can be loaded.

View File

@ -76,7 +76,8 @@ inline bool FormAccountDetails::applyInternal() {
if (m_account == nullptr) {
m_account = new T();
m_account->setAccountId(DatabaseQueries::createBaseAccount(database, m_account->code()));
m_account->setId(m_account->accountId());
//m_account->setId(m_account->accountId());
}
// NOTE: We edit account common attributes here directly.