[db] v21.4 - add playlist..artwork_url column

This commit is contained in:
whatdoineed2do/Ray 2020-04-26 17:11:03 +01:00 committed by ejurgensen
parent d84ea2008f
commit 9a0c7e9ad2
3 changed files with 21 additions and 2 deletions

View File

@ -115,7 +115,8 @@
" directory_id INTEGER DEFAULT 0," \
" query_order VARCHAR(1024)," \
" query_limit INTEGER DEFAULT -1," \
" media_kind INTEGER DEFAULT 1" \
" media_kind INTEGER DEFAULT 1," \
" artwork_url VARCHAR(4096) DEFAULT NULL" \
");"
#define T_PLITEMS \

View File

@ -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 21
#define SCHEMA_VERSION_MINOR 03
#define SCHEMA_VERSION_MINOR 04
int
db_init_indices(sqlite3 *hdl);

View File

@ -1048,6 +1048,17 @@ static const struct db_upgrade_query db_upgrade_v2103_queries[] =
{ U_V2103_SCVER_MINOR, "set schema_version_minor to 03" },
};
#define U_v2104_ALTER_PLAYLISTS_ADD_ARTWORK_URL \
"ALTER TABLE playlists ADD COLUMN artwork_url VARCHAR(4096) DEFAULT NULL;"
#define U_v2104_SCVER_MINOR \
"UPDATE admin SET value = '04' WHERE key = 'schema_version_minor';"
static const struct db_upgrade_query db_upgrade_v2104_queries[] =
{
{ U_v2104_ALTER_PLAYLISTS_ADD_ARTWORK_URL, "alter table playlists add column artwork_url" },
{ U_v2104_SCVER_MINOR, "set schema_version_minor to 04" },
};
int
@ -1215,6 +1226,13 @@ db_upgrade(sqlite3 *hdl, int db_ver)
case 2102:
ret = db_generic_upgrade(hdl, db_upgrade_v2103_queries, ARRAY_SIZE(db_upgrade_v2103_queries));
if (ret < 0)
return -1;
/* FALLTHROUGH */
case 2103:
ret = db_generic_upgrade(hdl, db_upgrade_v2104_queries, ARRAY_SIZE(db_upgrade_v2104_queries));
if (ret < 0)
return -1;
break;