aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLInventoryData.cs
diff options
context:
space:
mode:
authorSean Dague2008-06-12 15:47:33 +0000
committerSean Dague2008-06-12 15:47:33 +0000
commite1140a4f9ba4b0d6b62002927dcde27d85a22ff0 (patch)
treee1f010c1108afa1b424e0b065d9f743f07fed512 /OpenSim/Data/MySQL/MySQLInventoryData.cs
parentcheck in region store initial migration definition, (diff)
downloadopensim-SC-e1140a4f9ba4b0d6b62002927dcde27d85a22ff0.zip
opensim-SC-e1140a4f9ba4b0d6b62002927dcde27d85a22ff0.tar.gz
opensim-SC-e1140a4f9ba4b0d6b62002927dcde27d85a22ff0.tar.bz2
opensim-SC-e1140a4f9ba4b0d6b62002927dcde27d85a22ff0.tar.xz
this, in theory, adds migration support to mysql for all
data sources besides the grid store. It is only lightly tested so the less adventurous should wait a couple of checkins before upgrading.
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLInventoryData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLInventoryData.cs34
1 files changed, 30 insertions, 4 deletions
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs
index 8e160b7..1b86abf 100644
--- a/OpenSim/Data/MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs
@@ -69,7 +69,16 @@ namespace OpenSim.Data.MySQL
69 new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, 69 new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling,
70 settingPort); 70 settingPort);
71 } 71 }
72 TestTables(database.Connection); 72
73 // This actually does the roll forward assembly stuff
74 Assembly assem = GetType().Assembly;
75 Migration m = new Migration(database.Connection, assem, "AssetStore");
76
77 // TODO: After rev 6000, remove this. People should have
78 // been rolled onto the new migration code by then.
79 TestTables(database.Connection, m);
80
81 m.Update();
73 } 82 }
74 83
75 #region Test and initialization code 84 #region Test and initialization code
@@ -107,7 +116,7 @@ namespace OpenSim.Data.MySQL
107 } 116 }
108 } 117 }
109 118
110 private void TestTables(MySqlConnection conn) 119 private void TestTables(MySqlConnection conn, Migration m)
111 { 120 {
112 Dictionary<string, string> tableList = new Dictionary<string, string>(); 121 Dictionary<string, string> tableList = new Dictionary<string, string>();
113 122
@@ -115,11 +124,28 @@ namespace OpenSim.Data.MySQL
115 tableList["inventoryitems"] = null; 124 tableList["inventoryitems"] = null;
116 125
117 database.GetTableVersion(tableList); 126 database.GetTableVersion(tableList);
118 m_log.Info("[INVENTORY DB]: Inventory Folder Version: " + tableList["inventoryfolders"]);
119 m_log.Info("[INVENTORY DB]: Inventory Items Version: " + tableList["inventoryitems"]);
120 127
128 // if we've already started using migrations, get out of
129 // here, we've got this under control
130 if (m.Version > 0)
131 return;
132
133 // if there are no tables, get out of here and let
134 // migrations do their job
135 if(
136 tableList["inventoryfolders"] == null &&
137 tableList["inventoryitems"] == null
138 )
139 return;
140
141 // otherwise, let the upgrade on legacy proceed...
121 UpgradeFoldersTable(tableList["inventoryfolders"]); 142 UpgradeFoldersTable(tableList["inventoryfolders"]);
122 UpgradeItemsTable(tableList["inventoryitems"]); 143 UpgradeItemsTable(tableList["inventoryitems"]);
144
145 // ... and set the version
146 if (m.Version == 0)
147 m.Version = 1;
148
123 } 149 }
124 150
125 #endregion 151 #endregion