banshee r4378 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Database



Author: gburt
Date: Fri Aug 15 18:05:36 2008
New Revision: 4378
URL: http://svn.gnome.org/viewvc/banshee?rev=4378&view=rev

Log:
2008-08-15  Gabriel Burt  <gabriel burt gmail com>

	* src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs:
	Fix bug with not triggering metadata refresh when migrating from 0.13.2.


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Database/BansheeDbFormatMigrator.cs	Fri Aug 15 18:05:36 2008
@@ -219,7 +219,7 @@
         private bool Migrate_1 ()
         {
             if (TableExists("Tracks")) {
-                InitializeFreshDatabase ();
+                InitializeFreshDatabase (true);
                 
                 uint timer_id = Log.DebugTimerStart ("Database Schema Migration");
 
@@ -240,7 +240,7 @@
                 
                 return false;
             } else {
-                InitializeFreshDatabase ();
+                InitializeFreshDatabase (false);
                 return false;
             }
         }
@@ -497,7 +497,7 @@
         
 #region Fresh database setup
         
-        private void InitializeFreshDatabase ()
+        private void InitializeFreshDatabase (bool refresh_metadata)
         {
             Execute("DROP TABLE IF EXISTS CoreConfiguration");
             Execute("DROP TABLE IF EXISTS CoreTracks");
@@ -519,7 +519,9 @@
                 )
             ");
             Execute (String.Format ("INSERT INTO CoreConfiguration VALUES (null, 'DatabaseVersion', {0})", CURRENT_VERSION));
-            Execute (String.Format ("INSERT INTO CoreConfiguration VALUES (null, 'MetadataVersion', {0})", CURRENT_METADATA_VERSION));
+            if (!refresh_metadata) {
+                Execute (String.Format ("INSERT INTO CoreConfiguration VALUES (null, 'MetadataVersion', {0})", CURRENT_METADATA_VERSION));
+            }
             
             Execute(@"
                 CREATE TABLE CorePrimarySources (



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]