From 9052c43319ab69f57b80e363d965780be625b0e2 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 2 Jul 2008 16:20:54 +0000 Subject: * 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 --- OpenSim/Data/MySQL/MySQLAssetData.cs | 8 +++----- OpenSim/Data/MySQL/Resources/004_AssetStore.sql | 5 +++++ 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 OpenSim/Data/MySQL/Resources/004_AssetStore.sql (limited to 'OpenSim/Data/MySQL') 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 { MySqlCommand cmd = new MySqlCommand( - "SELECT name, description, assetType, invType, local, temporary, data FROM assets WHERE id=?id", + "SELECT name, description, assetType, local, temporary, data FROM assets WHERE id=?id", _dbConnection.Connection); cmd.Parameters.AddWithValue("?id", assetID.ToString()); @@ -178,7 +178,6 @@ namespace OpenSim.Data.MySQL asset.Data = (byte[]) dbReader["data"]; asset.Description = (string) dbReader["description"]; asset.FullID = assetID; - asset.InvType = (sbyte) dbReader["invType"]; asset.Local = ((sbyte) dbReader["local"]) != 0 ? true : false; asset.Name = (string) dbReader["name"]; asset.Type = (sbyte) dbReader["assetType"]; @@ -216,8 +215,8 @@ namespace OpenSim.Data.MySQL MySqlCommand cmd = new MySqlCommand( - "REPLACE INTO assets(id, name, description, assetType, invType, local, temporary, data)" + - "VALUES(?id, ?name, ?description, ?assetType, ?invType, ?local, ?temporary, ?data)", + "REPLACE INTO assets(id, name, description, assetType, local, temporary, data)" + + "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?data)", _dbConnection.Connection); // need to ensure we dispose @@ -229,7 +228,6 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("?name", asset.Name); cmd.Parameters.AddWithValue("?description", asset.Description); cmd.Parameters.AddWithValue("?assetType", asset.Type); - cmd.Parameters.AddWithValue("?invType", asset.InvType); cmd.Parameters.AddWithValue("?local", asset.Local); cmd.Parameters.AddWithValue("?temporary", asset.Temporary); 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 @@ +BEGIN; + +ALTER TABLE assets drop InvType; + +COMMIT; -- cgit v1.1