From 5214d39e7ce0de3edc14d0a20c9652f0056ab045 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Fri, 14 Nov 2008 19:36:29 +0000 Subject: Mantis #2618 Thank you, StrawberryFride, for a patch that adds group permission support to MSSQL. Contains a migration, back up your database. --- OpenSim/Data/MSSQL/MSSQLInventoryData.cs | 6 ++++-- OpenSim/Data/MSSQL/MSSQLUserData.cs | 1 + OpenSim/Data/MSSQL/Resources/002_InventoryStore.sql | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 OpenSim/Data/MSSQL/Resources/002_InventoryStore.sql (limited to 'OpenSim') diff --git a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs index 79bab3b..eb31cc8 100644 --- a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs +++ b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs @@ -488,11 +488,11 @@ namespace OpenSim.Data.MSSQL string sql = "INSERT INTO inventoryitems"; sql += "([inventoryID], [assetID], [assetType], [parentFolderID], [avatarID], [inventoryName]" + ", [inventoryDescription], [inventoryNextPermissions], [inventoryCurrentPermissions]" - + ", [invType], [creatorID], [inventoryBasePermissions], [inventoryEveryOnePermissions]" + + ", [invType], [creatorID], [inventoryBasePermissions], [inventoryEveryOnePermissions], [inventoryGroupPermissions]" + ", [salePrice], [saleType], [creationDate], [groupID], [groupOwned], [flags]) VALUES "; sql += "(@inventoryID, @assetID, @assetType, @parentFolderID, @avatarID, @inventoryName, @inventoryDescription" + ", @inventoryNextPermissions, @inventoryCurrentPermissions, @invType, @creatorID" - + ", @inventoryBasePermissions, @inventoryEveryOnePermissions, @salePrice, @saleType" + + ", @inventoryBasePermissions, @inventoryEveryOnePermissions, @inventoryGroupPermissions, @salePrice, @saleType" + ", @creationDate, @groupID, @groupOwned, @flags);"; using (AutoClosingSqlCommand command = database.Query(sql)) @@ -510,6 +510,7 @@ namespace OpenSim.Data.MSSQL command.Parameters.Add(database.CreateParameter("creatorID", item.Creator)); command.Parameters.Add(database.CreateParameter("inventoryBasePermissions", item.BasePermissions)); command.Parameters.Add(database.CreateParameter("inventoryEveryOnePermissions", item.EveryOnePermissions)); + command.Parameters.Add(database.CreateParameter("inventoryGroupPermissions", item.GroupPermissions)); command.Parameters.Add(database.CreateParameter("salePrice", item.SalePrice)); command.Parameters.Add(database.CreateParameter("saleType", item.SaleType)); command.Parameters.Add(database.CreateParameter("creationDate", item.CreationDate)); @@ -786,6 +787,7 @@ namespace OpenSim.Data.MSSQL item.Creator = new UUID(reader["creatorID"].ToString()); item.BasePermissions = Convert.ToUInt32(reader["inventoryBasePermissions"]); item.EveryOnePermissions = Convert.ToUInt32(reader["inventoryEveryOnePermissions"]); + item.GroupPermissions = Convert.ToUInt32(reader["inventoryGroupPermissions"]); item.SalePrice = Convert.ToInt32(reader["salePrice"]); item.SaleType = Convert.ToByte(reader["saleType"]); item.CreationDate = Convert.ToInt32(reader["creationDate"]); diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs index dc7b6e4..22b3c94 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs @@ -679,6 +679,7 @@ namespace OpenSim.Data.MSSQL /// the appearence override public void UpdateUserAppearance(UUID user, AvatarAppearance appearance) { + m_log.Error("[USER DB] updating user appearance for user ID " + user.Guid.ToString()); string sql = String.Empty; sql += "DELETE FROM avatarappearance WHERE owner=@owner "; sql += "INSERT INTO avatarappearance "; diff --git a/OpenSim/Data/MSSQL/Resources/002_InventoryStore.sql b/OpenSim/Data/MSSQL/Resources/002_InventoryStore.sql new file mode 100644 index 0000000..bcc26b8 --- /dev/null +++ b/OpenSim/Data/MSSQL/Resources/002_InventoryStore.sql @@ -0,0 +1,5 @@ +BEGIN TRANSACTION + +ALTER TABLE inventoryitems ADD inventoryGroupPermissions INTEGER NOT NULL default 0 + +COMMIT \ No newline at end of file -- cgit v1.1