4
1
mirror of https://github.com/QuasarApp/Heart.git synced 2025-05-12 01:19:42 +00:00

fix sql file

This commit is contained in:
Andrei Yankovich 2021-10-09 19:10:50 +03:00
parent e217aadd48
commit e00b1ede3c
4 changed files with 13 additions and 11 deletions
Heart/DataBaseSpace
HeartTests/DataBaseSpace

@ -29,12 +29,12 @@ CREATE TABLE IF NOT EXISTS DefaultPermissions (
FOREIGN KEY(dbAddress) REFERENCES MemberPermisions(dbAddress)
ON UPDATE CASCADE
ON DELETE CASCADE
)
);
CREATE TABLE IF NOT EXISTS DataBaseAttributes (
name TEXT NOT NULL PRIMARY KEY,
value INT NOT NULL UNIQUE
)
);
INSERT INTO "DataBaseAttributes" VALUES ("version", 0);

@ -36,6 +36,6 @@ CREATE TABLE IF NOT EXISTS DefaultPermissions (
CREATE TABLE IF NOT EXISTS DataBaseAttributes (
name TEXT NOT NULL PRIMARY KEY,
value INT NOT NULL UNIQUE
)
);
INSERT INTO "DataBaseAttributes" VALUES ("version", 0);

@ -66,11 +66,17 @@ bool DataBaseNode::initSqlDb(QString DBparamsFile,
if (DBparamsFile.isEmpty()) {
params = defaultDbParams();
return _db->init(params);
}
if (!_db->init(DBparamsFile)) {
return false;
if (!_db->init(params)) {
return false;
}
} else {
if (!_db->init(DBparamsFile)) {
return false;
}
}
if (!upgradeDataBase()) {

@ -36,10 +36,6 @@ protected:
_ping.setAnsver(ping->ansver());
}
QMap<int, std::function<bool (const QH::iObjectProvider *)> > dbPatches() const override{
return {};
};
private:
QH::PKG::Ping _ping;