[db] v21.4 - add playlist..artwork_url column
This commit is contained in:
parent
d84ea2008f
commit
9a0c7e9ad2
|
@ -115,7 +115,8 @@
|
||||||
" directory_id INTEGER DEFAULT 0," \
|
" directory_id INTEGER DEFAULT 0," \
|
||||||
" query_order VARCHAR(1024)," \
|
" query_order VARCHAR(1024)," \
|
||||||
" query_limit INTEGER DEFAULT -1," \
|
" query_limit INTEGER DEFAULT -1," \
|
||||||
" media_kind INTEGER DEFAULT 1" \
|
" media_kind INTEGER DEFAULT 1," \
|
||||||
|
" artwork_url VARCHAR(4096) DEFAULT NULL" \
|
||||||
");"
|
");"
|
||||||
|
|
||||||
#define T_PLITEMS \
|
#define T_PLITEMS \
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
* is a major upgrade. In other words minor version upgrades permit downgrading
|
* is a major upgrade. In other words minor version upgrades permit downgrading
|
||||||
* forked-daapd after the database was upgraded. */
|
* forked-daapd after the database was upgraded. */
|
||||||
#define SCHEMA_VERSION_MAJOR 21
|
#define SCHEMA_VERSION_MAJOR 21
|
||||||
#define SCHEMA_VERSION_MINOR 03
|
#define SCHEMA_VERSION_MINOR 04
|
||||||
|
|
||||||
int
|
int
|
||||||
db_init_indices(sqlite3 *hdl);
|
db_init_indices(sqlite3 *hdl);
|
||||||
|
|
|
@ -1048,6 +1048,17 @@ static const struct db_upgrade_query db_upgrade_v2103_queries[] =
|
||||||
{ U_V2103_SCVER_MINOR, "set schema_version_minor to 03" },
|
{ 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
|
int
|
||||||
|
@ -1215,6 +1226,13 @@ db_upgrade(sqlite3 *hdl, int db_ver)
|
||||||
|
|
||||||
case 2102:
|
case 2102:
|
||||||
ret = db_generic_upgrade(hdl, db_upgrade_v2103_queries, ARRAY_SIZE(db_upgrade_v2103_queries));
|
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)
|
if (ret < 0)
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue