Bug 2138 - Problem upgrading MySQL schema to v16
: Problem upgrading MySQL schema to v16
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Database
: 6.2.0
: PC Windows XP
: P2 critical (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-09-16 11:03 UTC by Jim McAtee
Modified: 2008-09-15 14:36 UTC (History)
0 users

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim McAtee 2005-09-16 11:03:52 UTC
I believe r4306 updated the db schema version to 16.  Mine still says version 
15 and I see that there's no 16.sql file under server/SQL/Upgrades.

To fix the problema I dropped all tables in the db and let Slim Server rebuild 
the database.  Version 16 is now showing in the metainformation table.

This is what was showing in the logs during startup:

[code]2005-09-16 11:29:09.6481 Metadata database saving into: C:\Program 
Files\SlimServer\server\Cache\slimserversql.db
2005-09-16 11:29:09.6811 Connected to database dbi:mysql:dbname=slimserver
2005-09-16 11:29:09.6904 No upgrades found for database v. 15
2005-09-16 11:29:09.6913 DBI: Supressing periodic commit - no dirty items
2005-09-16 11:29:09.6922 loading types config file...
.
.
.
2005-09-16 11:29:27.9979 DBD::mysql::st execute failed: Unknown 
column 'musicbrainz_id' in 'field list' at C:\Program 
Files\SlimServer\server\CPAN/DBIx/ContextualFetch.pm line 51.
DBD::mysql::st execute failed: Unknown column 'musicbrainz_id' in 'field list' 
at C:\Program Files\SlimServer\server\CPAN/DBIx/ContextualFetch.pm line 51.
2005-09-16 11:29:27.9987 forceCommit: syncing to the database.[/code]
Comment 1 Jim McAtee 2005-09-16 11:39:36 UTC
I think the problem was in r4306.  It appears that the schema versions are off -
 the dbcreate.sql uses version 16, while the update SQL is "upping" only to 
15.  I imagine it works for anyone that wasn't already at db schema version 15, 
which was an update in r4292, but only done in the dbcreate.sql.  So the 
version 15 would only have been set by r4292 if you did a rescan with 
a 'clear', which I did.

From r4306:

Added: trunk/server/SQL/mysql/Upgrades/15.sql
===================================================================
--- trunk/server/SQL/mysql/Upgrades/15.sql	2005-09-15 23:13:06 UTC (rev 
4305)
+++ trunk/server/SQL/mysql/Upgrades/15.sql	2005-09-15 23:35:46 UTC (rev 
4306)
@@ -0,0 +1,4 @@
+-- 
+-- Force db recreation by upping the schema version
+
+UPDATE metainformation SET version = 15;


Property changes on: trunk/server/SQL/mysql/Upgrades/15.sql
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + "Id Author LastChangedDate LastChangedBy"
Name: svn:eol-style
   + native

Modified: trunk/server/SQL/mysql/dbcreate.sql
===================================================================
--- trunk/server/SQL/mysql/dbcreate.sql	2005-09-15 23:13:06 UTC (rev 4305)
+++ trunk/server/SQL/mysql/dbcreate.sql	2005-09-15 23:35:46 UTC (rev 4306)
@@ -16,7 +16,7 @@
   total_time  int(10) unsigned
 ) TYPE=InnoDB;
 
-INSERT INTO metainformation VALUES (15, 0, 0);
+INSERT INTO metainformation VALUES (16, 0, 0);
Comment 2 Dan Sully 2005-09-18 23:34:40 UTC
This appears to have been fixed while I was away for the weekend.