diff options
author | Justin Clarke Casey | 2008-07-02 16:20:54 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-07-02 16:20:54 +0000 |
commit | 9052c43319ab69f57b80e363d965780be625b0e2 (patch) | |
tree | 3e17e9c0908be54ecb01ddff824d6c1a32020e88 /OpenSim/Data/MySQL | |
parent | Mantis#1647. Thank you kindly, Sempuki for a patch that: (diff) | |
download | opensim-SC-9052c43319ab69f57b80e363d965780be625b0e2.zip opensim-SC-9052c43319ab69f57b80e363d965780be625b0e2.tar.gz opensim-SC-9052c43319ab69f57b80e363d965780be625b0e2.tar.bz2 opensim-SC-9052c43319ab69f57b80e363d965780be625b0e2.tar.xz |
* Drop InvType from the assets table since it is no longer used
* Migration should be automatic on sqlite and mysql
* Migration is not automatic on mssql, you will need to drop the invType column manually
* Migration should be fine, but as for any db change, I would recommend making sure you have backups before moving past this revision
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAssetData.cs | 8 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/004_AssetStore.sql | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index d66a5c2..21d730d 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -164,7 +164,7 @@ namespace OpenSim.Data.MySQL | |||
164 | { | 164 | { |
165 | MySqlCommand cmd = | 165 | MySqlCommand cmd = |
166 | new MySqlCommand( | 166 | new MySqlCommand( |
167 | "SELECT name, description, assetType, invType, local, temporary, data FROM assets WHERE id=?id", | 167 | "SELECT name, description, assetType, local, temporary, data FROM assets WHERE id=?id", |
168 | _dbConnection.Connection); | 168 | _dbConnection.Connection); |
169 | cmd.Parameters.AddWithValue("?id", assetID.ToString()); | 169 | cmd.Parameters.AddWithValue("?id", assetID.ToString()); |
170 | 170 | ||
@@ -178,7 +178,6 @@ namespace OpenSim.Data.MySQL | |||
178 | asset.Data = (byte[]) dbReader["data"]; | 178 | asset.Data = (byte[]) dbReader["data"]; |
179 | asset.Description = (string) dbReader["description"]; | 179 | asset.Description = (string) dbReader["description"]; |
180 | asset.FullID = assetID; | 180 | asset.FullID = assetID; |
181 | asset.InvType = (sbyte) dbReader["invType"]; | ||
182 | asset.Local = ((sbyte) dbReader["local"]) != 0 ? true : false; | 181 | asset.Local = ((sbyte) dbReader["local"]) != 0 ? true : false; |
183 | asset.Name = (string) dbReader["name"]; | 182 | asset.Name = (string) dbReader["name"]; |
184 | asset.Type = (sbyte) dbReader["assetType"]; | 183 | asset.Type = (sbyte) dbReader["assetType"]; |
@@ -216,8 +215,8 @@ namespace OpenSim.Data.MySQL | |||
216 | 215 | ||
217 | MySqlCommand cmd = | 216 | MySqlCommand cmd = |
218 | new MySqlCommand( | 217 | new MySqlCommand( |
219 | "REPLACE INTO assets(id, name, description, assetType, invType, local, temporary, data)" + | 218 | "REPLACE INTO assets(id, name, description, assetType, local, temporary, data)" + |
220 | "VALUES(?id, ?name, ?description, ?assetType, ?invType, ?local, ?temporary, ?data)", | 219 | "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?data)", |
221 | _dbConnection.Connection); | 220 | _dbConnection.Connection); |
222 | 221 | ||
223 | // need to ensure we dispose | 222 | // need to ensure we dispose |
@@ -229,7 +228,6 @@ namespace OpenSim.Data.MySQL | |||
229 | cmd.Parameters.AddWithValue("?name", asset.Name); | 228 | cmd.Parameters.AddWithValue("?name", asset.Name); |
230 | cmd.Parameters.AddWithValue("?description", asset.Description); | 229 | cmd.Parameters.AddWithValue("?description", asset.Description); |
231 | cmd.Parameters.AddWithValue("?assetType", asset.Type); | 230 | cmd.Parameters.AddWithValue("?assetType", asset.Type); |
232 | cmd.Parameters.AddWithValue("?invType", asset.InvType); | ||
233 | cmd.Parameters.AddWithValue("?local", asset.Local); | 231 | cmd.Parameters.AddWithValue("?local", asset.Local); |
234 | cmd.Parameters.AddWithValue("?temporary", asset.Temporary); | 232 | cmd.Parameters.AddWithValue("?temporary", asset.Temporary); |
235 | cmd.Parameters.AddWithValue("?data", asset.Data); | 233 | cmd.Parameters.AddWithValue("?data", asset.Data); |
diff --git a/OpenSim/Data/MySQL/Resources/004_AssetStore.sql b/OpenSim/Data/MySQL/Resources/004_AssetStore.sql new file mode 100644 index 0000000..9e9b9fe --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/004_AssetStore.sql | |||
@@ -0,0 +1,5 @@ | |||
1 | BEGIN; | ||
2 | |||
3 | ALTER TABLE assets drop InvType; | ||
4 | |||
5 | COMMIT; | ||