aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLGridData.cs
diff options
context:
space:
mode:
authorSean Dague2008-06-19 15:03:00 +0000
committerSean Dague2008-06-19 15:03:00 +0000
commitfcd7cf5e4a7ef0a998e3d05236f8cb161e5c1bef (patch)
tree9ae2d62799dd826e69f6c8e75daddf944d35970a /OpenSim/Data/MySQL/MySQLGridData.cs
parentoops, it helps to reference the *right* migration (diff)
downloadopensim-SC_OLD-fcd7cf5e4a7ef0a998e3d05236f8cb161e5c1bef.zip
opensim-SC_OLD-fcd7cf5e4a7ef0a998e3d05236f8cb161e5c1bef.tar.gz
opensim-SC_OLD-fcd7cf5e4a7ef0a998e3d05236f8cb161e5c1bef.tar.bz2
opensim-SC_OLD-fcd7cf5e4a7ef0a998e3d05236f8cb161e5c1bef.tar.xz
fix an edge case with migrations in the region store.
Add migration support to gridstore.
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLGridData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLGridData.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/OpenSim/Data/MySQL/MySQLGridData.cs b/OpenSim/Data/MySQL/MySQLGridData.cs
index 86ceffc..e5940e2 100644
--- a/OpenSim/Data/MySQL/MySQLGridData.cs
+++ b/OpenSim/Data/MySQL/MySQLGridData.cs
@@ -72,7 +72,15 @@ namespace OpenSim.Data.MySQL
72 settingPooling, settingPort); 72 settingPooling, settingPort);
73 } 73 }
74 74
75 TestTables(); 75 // This actually does the roll forward assembly stuff
76 Assembly assem = GetType().Assembly;
77 Migration m = new Migration(database.Connection, assem, "GridStore");
78
79 // TODO: After rev 6000, remove this. People should have
80 // been rolled onto the new migration code by then.
81 TestTables(m);
82
83 m.Update();
76 } 84 }
77 85
78 #region Test and initialization code 86 #region Test and initialization code
@@ -80,14 +88,22 @@ namespace OpenSim.Data.MySQL
80 /// <summary> 88 /// <summary>
81 /// Ensure that the user related tables exists and are at the latest version 89 /// Ensure that the user related tables exists and are at the latest version
82 /// </summary> 90 /// </summary>
83 private void TestTables() 91 private void TestTables(Migration m)
84 { 92 {
93 // we already have migrations, get out of here
94 if (m.Version > 0)
95 return;
96
85 Dictionary<string, string> tableList = new Dictionary<string, string>(); 97 Dictionary<string, string> tableList = new Dictionary<string, string>();
86 98
87 tableList["regions"] = null; 99 tableList["regions"] = null;
88 database.GetTableVersion(tableList); 100 database.GetTableVersion(tableList);
89 101
90 UpgradeRegionsTable(tableList["regions"]); 102 UpgradeRegionsTable(tableList["regions"]);
103
104 // we have tables, but not a migration model yet
105 if (m.Version == 0)
106 m.Version = 1;
91 } 107 }
92 108
93 /// <summary> 109 /// <summary>