mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-25 04:19:15 -05:00
Make sure there are no remnants from last upgrade before upgrading the db
This commit is contained in:
parent
ae51922f57
commit
dd4ebfc42e
11
src/db.c
11
src/db.c
@ -4577,6 +4577,17 @@ db_upgrade_files_table(const char *dumpquery, const char *newtablequery)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Drop remnants from last upgrade if still present */
|
||||||
|
DPRINTF(E_LOG, L_DB, "Clearing old backups...\n");
|
||||||
|
|
||||||
|
ret = sqlite3_exec(hdl, "DROP TABLE IF EXISTS files_backup;", NULL, NULL, &errmsg);
|
||||||
|
if (ret != SQLITE_OK)
|
||||||
|
{
|
||||||
|
DPRINTF(E_LOG, L_DB, "Error clearing old backup - will continue anyway: %s\n", errmsg);
|
||||||
|
|
||||||
|
sqlite3_free(errmsg);
|
||||||
|
}
|
||||||
|
|
||||||
/* Move old table out of the way */
|
/* Move old table out of the way */
|
||||||
DPRINTF(E_LOG, L_DB, "Moving old files table out of the way...\n");
|
DPRINTF(E_LOG, L_DB, "Moving old files table out of the way...\n");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user