mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-01 02:48:05 +01:00
more wokr
This commit is contained in:
parent
fbf2d0912f
commit
981f1eac76
@ -1,8 +1,8 @@
|
|||||||
DROP TABLE IF EXISTS Information;
|
DROP TABLE IF EXISTS Information;
|
||||||
-- !
|
-- !
|
||||||
CREATE TABLE IF NOT EXISTS Information (
|
CREATE TABLE IF NOT EXISTS Information (
|
||||||
key TEXT PRIMARY KEY,
|
key TEXT PRIMARY KEY,
|
||||||
value TEXT NOT NULL
|
value TEXT NOT NULL
|
||||||
);
|
);
|
||||||
-- !
|
-- !
|
||||||
INSERT INTO Information VALUES ('schema_version', '0.0.1');
|
INSERT INTO Information VALUES ('schema_version', '0.0.1');
|
||||||
@ -10,8 +10,41 @@ INSERT INTO Information VALUES ('schema_version', '0.0.1');
|
|||||||
DROP TABLE IF EXISTS Categories;
|
DROP TABLE IF EXISTS Categories;
|
||||||
-- !
|
-- !
|
||||||
CREATE TABLE IF NOT EXISTS Categories (
|
CREATE TABLE IF NOT EXISTS Categories (
|
||||||
id INTEGER PRIMARY KEY,
|
id INTEGER PRIMARY KEY,
|
||||||
title TEXT NOT NULL UNIQUE CHECK(title != ''),
|
title TEXT NOT NULL UNIQUE CHECK (title != ''),
|
||||||
description TEXT
|
description TEXT,
|
||||||
|
date_created TEXT NOT NULL CHECK (date_created != ''),
|
||||||
icon BLOB
|
icon BLOB
|
||||||
|
);
|
||||||
|
-- !
|
||||||
|
DROP TABLE IF EXISTS Feeds;
|
||||||
|
-- !
|
||||||
|
CREATE TABLE IF NOT EXISTS Feeds (
|
||||||
|
id INTEGER PRIMARY KEY,
|
||||||
|
title TEXT NOT NULL UNIQUE CHECK (title != ''),
|
||||||
|
description TEXT,
|
||||||
|
date_created TEXT NOT NULL CHECK (date_created != ''),
|
||||||
|
icon BLOB,
|
||||||
|
category INTEGER NOT NULL CHECK (category >= -1),
|
||||||
|
encoding TEXT NOT NULL CHECK (encoding != ''),
|
||||||
|
url TEXT NOT NULL CHECK (url != ''),
|
||||||
|
type INTEGER NOT NULL
|
||||||
|
);
|
||||||
|
-- !
|
||||||
|
DROP TABLE IF EXISTS Messages;
|
||||||
|
-- !
|
||||||
|
CREATE TABLE IF NOT EXISTS Messages (
|
||||||
|
id INTEGER PRIMARY KEY,
|
||||||
|
title TEXT NOT NULL CHECK (title != ''),
|
||||||
|
owner INTEGER NOT NULL,
|
||||||
|
url TEXT,
|
||||||
|
author TEXT,
|
||||||
|
date_created TEXT NOT NULL CHECK (date_created != ''),
|
||||||
|
date_updated TEXT,
|
||||||
|
contents TEXT,
|
||||||
|
read INTEGER(1) NOT NULL CHECK (read >= 0 AND read <= 1) DEFAULT (0),
|
||||||
|
deleted INTEGER(1) NOT NULL CHECK (deleted >= 0 AND deleted <= 1) DEFAULT (0),
|
||||||
|
important INTEGER(1) NOT NULL CHECK (important >= 0 AND important <= 1) DEFAULT (0),
|
||||||
|
|
||||||
|
FOREIGN KEY (owner) REFERENCES Feeds (id)
|
||||||
);
|
);
|
@ -90,18 +90,22 @@ QSqlDatabase DatabaseFactory::initialize(const QString &connection_name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
database.exec("COMMIT");
|
database.exec("COMMIT");
|
||||||
qWarning("Database backend should be ready now.");
|
qDebug("Database backend should be ready now.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
q.next();
|
q.next();
|
||||||
|
|
||||||
qDebug("Database connection '%s' to file '%s' seems to be established.",
|
qDebug("Database connection '%s' to file '%s' seems to be established.",
|
||||||
qPrintable(connection_name),
|
qPrintable(connection_name),
|
||||||
qPrintable(QDir::toNativeSeparators(database.databaseName())));
|
qPrintable(QDir::toNativeSeparators(database.databaseName())));
|
||||||
qDebug("Database has version '%s'.", qPrintable(q.value(0).toString()));
|
qDebug("Database has version '%s'.", qPrintable(q.value(0).toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
q.finish();
|
q.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_initialized = true;
|
||||||
|
|
||||||
return database;
|
return database;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user