aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL/MySQLInventoryData.cs
diff options
context:
space:
mode:
authorSean Dague2008-08-27 18:51:40 +0000
committerSean Dague2008-08-27 18:51:40 +0000
commitba16a27ab0faa553f4dc57499456f274f3538188 (patch)
tree734892d0522d75b4689cf2bd18f5ea3852b4edd4 /OpenSim/Data/MySQL/MySQLInventoryData.cs
parentwe're past checkin 6000, so now cleaning up all the cruft of the pre (diff)
downloadopensim-SC_OLD-ba16a27ab0faa553f4dc57499456f274f3538188.zip
opensim-SC_OLD-ba16a27ab0faa553f4dc57499456f274f3538188.tar.gz
opensim-SC_OLD-ba16a27ab0faa553f4dc57499456f274f3538188.tar.bz2
opensim-SC_OLD-ba16a27ab0faa553f4dc57499456f274f3538188.tar.xz
remove pre-Migration upgrade paths
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLInventoryData.cs')
-rw-r--r--OpenSim/Data/MySQL/MySQLInventoryData.cs92
1 files changed, 0 insertions, 92 deletions
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs
index 4e8200b..fe2d393 100644
--- a/OpenSim/Data/MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs
@@ -90,101 +90,9 @@ namespace OpenSim.Data.MySQL
90 // This actually does the roll forward assembly stuff 90 // This actually does the roll forward assembly stuff
91 Assembly assem = GetType().Assembly; 91 Assembly assem = GetType().Assembly;
92 Migration m = new Migration(database.Connection, assem, "InventoryStore"); 92 Migration m = new Migration(database.Connection, assem, "InventoryStore");
93
94 // TODO: After rev 6000, remove this. People should have
95 // been rolled onto the new migration code by then.
96 TestTables(database.Connection, m);
97
98 m.Update(); 93 m.Update();
99 } 94 }
100 95
101 #region Test and initialization code
102
103 /// <summary>
104 /// <list type="bullet">
105 /// <item>Execute CreateFoldersTable.sql if oldVersion == null</item>
106 /// <item>do nothing if oldVersion != null</item>
107 /// </list>
108 /// </summary>
109 /// <param name="oldVersion"></param>
110 private void UpgradeFoldersTable(string oldVersion)
111 {
112 // null as the version, indicates that the table didn't exist
113 if (oldVersion == null)
114 {
115 database.ExecuteResourceSql("CreateFoldersTable.sql");
116 return;
117 }
118
119 //// if the table is already at the current version, then we can exit immediately
120 // if (oldVersion == "Rev. 2")
121 // return;
122 // database.ExecuteResourceSql("UpgradeFoldersTableToVersion2.sql");
123 }
124
125 /// <summary>
126 /// <list type="bullet">
127 /// <item>Execute CreateItemsTable.sql if oldVersion == null</item>
128 /// <item>Execute "UpgradeItemsTableToVersion3.sql" if oldVersion start with "Rev. 2;"</item>
129 /// </list>
130 /// </summary>
131 /// <param name="oldVersion"></param>
132 private void UpgradeItemsTable(string oldVersion)
133 {
134 // null as the version, indicates that the table didn't exist
135 if (oldVersion == null)
136 {
137 database.ExecuteResourceSql("CreateItemsTable.sql");
138 return;
139 }
140
141 // if the table is already at the current version, then we can exit immediately
142 if (oldVersion.StartsWith("Rev. 2;"))
143 {
144 m_log.Info("[INVENTORY DB]: Upgrading inventory items table from Rev. 2 to Rev. 3");
145 database.ExecuteResourceSql("UpgradeItemsTableToVersion3.sql");
146 }
147 }
148
149 /// <summary>
150 ///
151 /// </summary>
152 /// <param name="conn">MySQL connection handler</param>
153 /// <param name="m"></param>
154 private void TestTables(MySqlConnection conn, Migration m)
155 {
156 Dictionary<string, string> tableList = new Dictionary<string, string>();
157
158 tableList["inventoryfolders"] = null;
159 tableList["inventoryitems"] = null;
160
161 database.GetTableVersion(tableList);
162
163 // if we've already started using migrations, get out of
164 // here, we've got this under control
165 if (m.Version > 0)
166 return;
167
168 // if there are no tables, get out of here and let
169 // migrations do their job
170 if (
171 tableList["inventoryfolders"] == null &&
172 tableList["inventoryitems"] == null
173 )
174 return;
175
176 // otherwise, let the upgrade on legacy proceed...
177 UpgradeFoldersTable(tableList["inventoryfolders"]);
178 UpgradeItemsTable(tableList["inventoryitems"]);
179
180 // ... and set the version
181 if (m.Version == 0)
182 m.Version = 1;
183
184 }
185
186 #endregion
187
188 /// <summary> 96 /// <summary>
189 /// The name of this DB provider 97 /// The name of this DB provider
190 /// </summary> 98 /// </summary>