Fix db upgrade from 12 -> 13

This commit is contained in:
Ron Pedde 2006-11-19 18:58:03 +00:00
parent 4d8e618f75
commit d5506fc46f
4 changed files with 31 additions and 28 deletions

View File

@ -65,7 +65,7 @@
<short_description>
Should the logfile get truncated on startup?
</short_description>
<type default_value="1">select</type>
<type default_value="0">select</type>
<options>
<option value="0">No</option>
<option value="1">Yes</option>

View File

@ -126,6 +126,7 @@ static CONF_ELEMENTS conf_elements[] = {
{ 0, 0, CONF_T_STRING,"general","never_transcode" },
{ 0, 0, CONF_T_MULTICOMMA,"general","compdirs" },
{ 0, 0, CONF_T_STRING,"general","logfile" },
{ 0, 0, CONF_T_INT,"general","truncate" },
{ 0, 0, CONF_T_EXISTPATH,"plugins","plugin_dir" },
{ 0, 0, CONF_T_MULTICOMMA,"plugins","plugins" },
{ 0, 0, CONF_T_INT,"daap","empty_strings" },

View File

@ -69,7 +69,7 @@ static char *db_sqlite2_enum_query;
static char db_sqlite2_path[PATH_MAX + 1];
#define DB_SQLITE2_VERSION 12
#define DB_SQLITE2_VERSION 13
/* Forwards */
@ -157,7 +157,8 @@ int db_sqlite2_open(char **pe, char *dsn) {
DPRINTF(E_LOG,L_DB,"Can't get db version. New database?\n");
} else if(ver != DB_SQLITE2_VERSION) {
/* we'll deal with this in the db handler */
DPRINTF(E_LOG,L_DB,"Old database version.\n");
DPRINTF(E_LOG,L_DB,"Old database version: %d, expecting %d\n",
ver, DB_SQLITE2_VERSION);
db_get_error(pe,DB_E_WRONGVERSION);
return DB_E_WRONGVERSION;
}

View File

@ -152,7 +152,8 @@ int db_sqlite3_open(char **pe, char *dsn) {
/* we'll catch this on the init */
DPRINTF(E_LOG,L_DB,"Can't get db version. New database?\n");
} else if(ver != DB_SQLITE3_VERSION) {
DPRINTF(E_LOG,L_DB,"Old database version.\n");
DPRINTF(E_LOG,L_DB,"Old database version: %d, expecting %d\n",
ver,DB_SQLITE3_VERSION);
db_get_error(pe,DB_E_WRONGVERSION);
return DB_E_WRONGVERSION;
}