[db] Use a minor version update for the new queue table (v19.01 instead

of v20.00)
This commit is contained in:
chme 2016-12-04 07:28:06 +01:00
parent fdd85ccf66
commit d431ace5c4
2 changed files with 7 additions and 7 deletions

View File

@ -25,8 +25,8 @@
* version of the database? If yes, then it is a minor upgrade, if no, then it * version of the database? If yes, then it is a minor upgrade, if no, then it
* 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 20 #define SCHEMA_VERSION_MAJOR 19
#define SCHEMA_VERSION_MINOR 00 #define SCHEMA_VERSION_MINOR 01
int int
db_init_indices(sqlite3 *hdl); db_init_indices(sqlite3 *hdl);

View File

@ -1479,13 +1479,13 @@ db_upgrade_v19(sqlite3 *hdl)
#define U_V2000_SCVER_MINOR \ #define U_V2000_SCVER_MINOR \
"UPDATE admin SET value = '00' WHERE key = 'schema_version_minor';" "UPDATE admin SET value = '00' WHERE key = 'schema_version_minor';"
static const struct db_upgrade_query db_upgrade_v2000_queries[] = static const struct db_upgrade_query db_upgrade_v1901_queries[] =
{ {
{ U_V2000_CREATE_TABLE_QUEUE, "create table directories" }, { U_V2000_CREATE_TABLE_QUEUE, "create table directories" },
{ U_V2000_QUEUE_VERSION, "insert plversion" }, { U_V2000_QUEUE_VERSION, "insert queue version" },
{ U_V2000_SCVER_MAJOR, "set schema_version_major to 20" }, { U_V2000_SCVER_MAJOR, "set schema_version_major to 19" },
{ U_V2000_SCVER_MINOR, "set schema_version_minor to 00" }, { U_V2000_SCVER_MINOR, "set schema_version_minor to 01" },
}; };
@ -1602,7 +1602,7 @@ db_upgrade(sqlite3 *hdl, int db_ver)
/* FALLTHROUGH */ /* FALLTHROUGH */
case 1900: case 1900:
ret = db_generic_upgrade(hdl, db_upgrade_v2000_queries, sizeof(db_upgrade_v2000_queries) / sizeof(db_upgrade_v2000_queries[0])); ret = db_generic_upgrade(hdl, db_upgrade_v1901_queries, sizeof(db_upgrade_v1901_queries) / sizeof(db_upgrade_v1901_queries[0]));
if (ret < 0) if (ret < 0)
return -1; return -1;