From 8a8c89a0f32b528bd588715bdbfc875c852e7187 Mon Sep 17 00:00:00 2001 From: Brian McBee Date: Sat, 15 Dec 2007 04:57:14 +0000 Subject: Grid Inventory feature upgrade: renaming folders should now be correct, subfolders work, moving folders works. Tested only in MYSQL, but may work in MSSQL and sqlite. Probably not working in standalone mode. --- OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs') diff --git a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs index edf7c43..6828f66 100644 --- a/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs +++ b/OpenSim/Framework/Data.MySQL/MySQLInventoryData.cs @@ -529,6 +529,28 @@ namespace OpenSim.Framework.Data.MySQL addInventoryFolder(folder); } + /// Creates a new inventory folder + /// + /// Folder to create + public void moveInventoryFolder(InventoryFolderBase folder) + { + string sql = + "UPDATE inventoryfolders SET parentFolderID=?parentFolderID WHERE folderID=?folderID"; + + MySqlCommand cmd = new MySqlCommand(sql, database.Connection); + cmd.Parameters.AddWithValue("?folderID", folder.folderID.ToStringHyphenated()); + cmd.Parameters.AddWithValue("?parentFolderID", folder.parentID.ToStringHyphenated()); + + + try + { + cmd.ExecuteNonQuery(); + } + catch (Exception e) + { + MainLog.Instance.Error(e.ToString()); + } + } /// /// Append a list of all the child folders of a parent folder -- cgit v1.1