mirror of
https://github.com/strawberrymusicplayer/strawberry
synced 2025-01-28 16:20:26 +01:00
Fix DB schema
This commit is contained in:
parent
41b0b1efd4
commit
3b30e66e87
@ -1,8 +1,10 @@
|
||||
CREATE TABLE IF NOT EXISTS schema_version (
|
||||
version INTEGER NOT NULL
|
||||
);
|
||||
|
||||
DELETE FROM schema_version;
|
||||
REPLACE INTO schema_version (version) VALUES (1);
|
||||
|
||||
INSERT INTO schema_version (version) VALUES (1);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS directories (
|
||||
path TEXT NOT NULL,
|
||||
|
@ -439,9 +439,11 @@ void Database::UpdateDatabaseSchema(int version, QSqlDatabase &db) {
|
||||
|
||||
QString filename;
|
||||
if (version == 0) filename = ":/schema/schema.sql";
|
||||
else filename = QString(":/schema/schema-%1.sql").arg(version);
|
||||
|
||||
else {
|
||||
filename = QString(":/schema/schema-%1.sql").arg(version);
|
||||
qLog(Debug) << "Applying database schema update" << version << "from" << filename;
|
||||
}
|
||||
|
||||
ExecSchemaCommandsFromFile(db, filename, version - 1);
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user