mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:46:03 +00:00
Fix previous commit.
This commit is contained in:
parent
2bb0e4b238
commit
a487c9777b
8
src/ui/3rdparty/sqlite/sqlitedb.cpp
vendored
8
src/ui/3rdparty/sqlite/sqlitedb.cpp
vendored
@ -216,12 +216,12 @@ bool SqliteDb::setEncoding(const QString &v)
|
||||
return executeStr(sql);
|
||||
}
|
||||
|
||||
QString SqliteDb::migrateOldSchemaName()
|
||||
QString SqliteDb::migrationOldSchemaName()
|
||||
{
|
||||
return QLatin1String("old");
|
||||
}
|
||||
|
||||
QString SqliteDb::migrateNewSchemaName()
|
||||
QString SqliteDb::migrationNewSchemaName()
|
||||
{
|
||||
return QLatin1String("main");
|
||||
}
|
||||
@ -376,8 +376,8 @@ bool SqliteDb::migrate(const QString &sqlDir, const char *sqlPragmas, int versio
|
||||
bool SqliteDb::importDb(
|
||||
const QString &sourceFilePath, SQLITEDB_MIGRATE_FUNC migrateFunc, void *migrateContext)
|
||||
{
|
||||
const QString srcSchema = migrateOldSchemaName();
|
||||
const QString dstSchema = migrateNewSchemaName();
|
||||
const QString srcSchema = migrationOldSchemaName();
|
||||
const QString dstSchema = migrationNewSchemaName();
|
||||
|
||||
if (!attach(srcSchema, sourceFilePath)) {
|
||||
dbWarning() << "Cannot attach the DB" << sourceFilePath << "Error:" << errorMessage();
|
||||
|
4
src/ui/3rdparty/sqlite/sqlitedb.h
vendored
4
src/ui/3rdparty/sqlite/sqlitedb.h
vendored
@ -59,8 +59,8 @@ public:
|
||||
QString encoding();
|
||||
bool setEncoding(const QString &v);
|
||||
|
||||
static QString migrateOldSchemaName();
|
||||
static QString migrateNewSchemaName();
|
||||
static QString migrationOldSchemaName();
|
||||
static QString migrationNewSchemaName();
|
||||
static QString entityName(const QString &schemaName, const QString &objectName);
|
||||
QStringList tableNames(const QString &schemaName = QString());
|
||||
QStringList columnNames(const QString &tableName, const QString &schemaName = QString());
|
||||
|
@ -33,8 +33,8 @@ bool migrateFunc(SqliteDb *db, int version, bool isNewDb, void *ctx)
|
||||
|
||||
if (version == 3 && !isNewDb) {
|
||||
// Move apps' total traffic to separate table
|
||||
const QString srcSchema = SqliteDb::migrateOldSchemaName();
|
||||
const QString dstSchema = SqliteDb::migrateNewSchemaName();
|
||||
const QString srcSchema = SqliteDb::migrationOldSchemaName();
|
||||
const QString dstSchema = SqliteDb::migrationNewSchemaName();
|
||||
|
||||
const auto sql = QString("INSERT INTO %1 (%3) SELECT %3 FROM %2;")
|
||||
.arg(SqliteDb::entityName(dstSchema, "traffic_app"),
|
||||
|
Loading…
Reference in New Issue
Block a user