Fix previous commit.

This commit is contained in:
Nodir Temirkhodjaev 2021-02-13 12:31:16 +05:00
parent 2bb0e4b238
commit a487c9777b
3 changed files with 8 additions and 8 deletions

View File

@ -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();

View File

@ -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());

View File

@ -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"),