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/MSSQL/MSSQLAssetData.cs | 10 +++------- OpenSim/Data/MSSQL/MSSQLManager.cs | 1 - OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql | 1 - 3 files changed, 3 insertions(+), 9 deletions(-) (limited to 'OpenSim/Data/MSSQL') diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index 44d78ed..3f2e8a7 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs @@ -63,6 +63,7 @@ namespace OpenSim.Data.MSSQL database.ExecuteResourceSql("CreateAssetsTable.sql"); return; } + } /// @@ -114,9 +115,9 @@ namespace OpenSim.Data.MSSQL SqlCommand cmd = new SqlCommand( - "INSERT INTO assets ([id], [name], [description], [assetType], [invType], [local], [temporary], [data])" + + "INSERT INTO assets ([id], [name], [description], [assetType], [local], [temporary], [data])" + " VALUES " + - "(@id, @name, @description, @assetType, @invType, @local, @temporary, @data)", + "(@id, @name, @description, @assetType, @local, @temporary, @data)", database.getConnection()); using (cmd) @@ -128,8 +129,6 @@ namespace OpenSim.Data.MSSQL cmd.Parameters.AddWithValue("description", asset.Description); SqlParameter e = cmd.Parameters.Add("assetType", SqlDbType.TinyInt); e.Value = asset.Type; - SqlParameter f = cmd.Parameters.Add("invType", SqlDbType.TinyInt); - f.Value = asset.InvType; SqlParameter g = cmd.Parameters.Add("local", SqlDbType.TinyInt); g.Value = asset.Local; SqlParameter h = cmd.Parameters.Add("temporary", SqlDbType.TinyInt); @@ -159,7 +158,6 @@ namespace OpenSim.Data.MSSQL "name = @name, " + "description = @description," + "assetType = @assetType," + - "invType = @invType," + "local = @local," + "temporary = @temporary," + "data = @data where " + @@ -168,7 +166,6 @@ namespace OpenSim.Data.MSSQL SqlParameter param2 = new SqlParameter("@name", asset.Name); SqlParameter param3 = new SqlParameter("@description", asset.Description); SqlParameter param4 = new SqlParameter("@assetType", asset.Type); - SqlParameter param5 = new SqlParameter("@invType", asset.InvType); SqlParameter param6 = new SqlParameter("@local", asset.Local); SqlParameter param7 = new SqlParameter("@temporary", asset.Temporary); SqlParameter param8 = new SqlParameter("@data", asset.Data); @@ -177,7 +174,6 @@ namespace OpenSim.Data.MSSQL command.Parameters.Add(param2); command.Parameters.Add(param3); command.Parameters.Add(param4); - command.Parameters.Add(param5); command.Parameters.Add(param6); command.Parameters.Add(param7); command.Parameters.Add(param8); diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs index bea02fe..e421c5d 100644 --- a/OpenSim/Data/MSSQL/MSSQLManager.cs +++ b/OpenSim/Data/MSSQL/MSSQLManager.cs @@ -405,7 +405,6 @@ namespace OpenSim.Data.MSSQL asset.Data = (byte[])reader["data"]; asset.Description = (string)reader["description"]; asset.FullID = new LLUUID((string)reader["id"]); - asset.InvType = Convert.ToSByte(reader["invType"]); asset.Local = Convert.ToBoolean(reader["local"]); // ((sbyte)reader["local"]) != 0 ? true : false; asset.Name = (string)reader["name"]; asset.Type = Convert.ToSByte(reader["assetType"]); diff --git a/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql b/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql index c7cb21a..4d94699 100644 --- a/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql +++ b/OpenSim/Data/MSSQL/Resources/CreateAssetsTable.sql @@ -6,7 +6,6 @@ CREATE TABLE [assets] ( [name] [varchar](64) NOT NULL, [description] [varchar](64) NOT NULL, [assetType] [tinyint] NOT NULL, - [invType] [tinyint] NOT NULL, [local] [tinyint] NOT NULL, [temporary] [tinyint] NOT NULL, [data] [image] NOT NULL, -- cgit v1.1