mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-25 22:55:56 -05:00
[db] Upgrade db to 19.03: Add artwork_url column to queue table
This commit is contained in:
parent
40d50d693b
commit
e92152cadb
@ -1,3 +1,4 @@
|
||||
|
||||
/*
|
||||
* Copyright (C) 2009-2011 Julien BLACHE <jb@jblache.org>
|
||||
* Copyright (C) 2010 Kai Elwert <elwertk@googlemail.com>
|
||||
@ -182,6 +183,7 @@
|
||||
" year INTEGER DEFAULT 0," \
|
||||
" track INTEGER DEFAULT 0," \
|
||||
" disc INTEGER DEFAULT 0" \
|
||||
" artwork_url VARCHAR(4096) DEFAULT NULL," \
|
||||
");"
|
||||
|
||||
#define TRG_GROUPS_INSERT_FILES \
|
||||
|
@ -26,7 +26,7 @@
|
||||
* is a major upgrade. In other words minor version upgrades permit downgrading
|
||||
* forked-daapd after the database was upgraded. */
|
||||
#define SCHEMA_VERSION_MAJOR 19
|
||||
#define SCHEMA_VERSION_MINOR 02
|
||||
#define SCHEMA_VERSION_MINOR 03
|
||||
|
||||
int
|
||||
db_init_indices(sqlite3 *hdl);
|
||||
|
@ -1529,6 +1529,24 @@ static const struct db_upgrade_query db_upgrade_v1902_queries[] =
|
||||
{ U_V1902_SCVER_MINOR, "set schema_version_minor to 02" },
|
||||
};
|
||||
|
||||
|
||||
#define U_V1903_ALTER_QUEUE_ADD_ARTWORKURL \
|
||||
"ALTER TABLE queue ADD COLUMN artwork_url VARCHAR(4096) DEFAULT NULL;"
|
||||
|
||||
#define U_V1903_SCVER_MAJOR \
|
||||
"UPDATE admin SET value = '19' WHERE key = 'schema_version_major';"
|
||||
#define U_V1903_SCVER_MINOR \
|
||||
"UPDATE admin SET value = '03' WHERE key = 'schema_version_minor';"
|
||||
|
||||
static const struct db_upgrade_query db_upgrade_v1903_queries[] =
|
||||
{
|
||||
{ U_V1903_ALTER_QUEUE_ADD_ARTWORKURL, "alter table queue add column artwork_url" },
|
||||
|
||||
{ U_V1903_SCVER_MAJOR, "set schema_version_major to 19" },
|
||||
{ U_V1903_SCVER_MINOR, "set schema_version_minor to 03" },
|
||||
};
|
||||
|
||||
|
||||
int
|
||||
db_upgrade(sqlite3 *hdl, int db_ver)
|
||||
{
|
||||
@ -1651,6 +1669,11 @@ db_upgrade(sqlite3 *hdl, int db_ver)
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
|
||||
case 1902:
|
||||
ret = db_generic_upgrade(hdl, db_upgrade_v1903_queries, sizeof(db_upgrade_v1903_queries) / sizeof(db_upgrade_v1903_queries[0]));
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user