mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-13 16:03:23 -05:00
Upgrade db schema to v16
This commit is contained in:
parent
2208c021aa
commit
bfa9f4d5cf
19
src/db.c
19
src/db.c
@ -4372,9 +4372,9 @@ db_perthread_deinit(void)
|
|||||||
" VALUES(8, 'Purchased', 0, 'media_kind = 1024', 0, '', 0, 8);"
|
" VALUES(8, 'Purchased', 0, 'media_kind = 1024', 0, '', 0, 8);"
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define SCHEMA_VERSION 15
|
#define SCHEMA_VERSION 16
|
||||||
#define Q_SCVER \
|
#define Q_SCVER \
|
||||||
"INSERT INTO admin (key, value) VALUES ('schema_version', '15');"
|
"INSERT INTO admin (key, value) VALUES ('schema_version', '16');"
|
||||||
|
|
||||||
struct db_init_query {
|
struct db_init_query {
|
||||||
char *query;
|
char *query;
|
||||||
@ -5405,6 +5405,14 @@ db_upgrade_v15(void)
|
|||||||
#undef Q_DUMP
|
#undef Q_DUMP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define U_V16_SCVER \
|
||||||
|
"UPDATE admin SET value = '16' WHERE key = 'schema_version';"
|
||||||
|
|
||||||
|
static const struct db_init_query db_upgrade_v16_queries[] =
|
||||||
|
{
|
||||||
|
{ U_V16_SCVER, "set schema_version to 16" },
|
||||||
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
db_check_version(void)
|
db_check_version(void)
|
||||||
{
|
{
|
||||||
@ -5502,6 +5510,13 @@ db_check_version(void)
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
/* FALLTHROUGH */
|
||||||
|
|
||||||
|
case 15:
|
||||||
|
ret = db_generic_upgrade(db_upgrade_v16_queries, sizeof(db_upgrade_v16_queries) / sizeof(db_upgrade_v16_queries[0]));
|
||||||
|
if (ret < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user