diff options
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLInventoryData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLInventoryData.cs | 57 |
1 files changed, 40 insertions, 17 deletions
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 2d93df3..911958c 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs | |||
@@ -49,12 +49,16 @@ namespace OpenSim.Data.MySQL | |||
49 | private MySQLManager database; | 49 | private MySQLManager database; |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Initialises User interface | 52 | /// <para>Initialises Inventory interface</para> |
53 | /// Loads and initialises the MySQL storage plugin | 53 | /// <para> |
54 | /// warns and uses the obsolete mysql_connection.ini if connect string is empty. | 54 | /// <list type="bullet"> |
55 | /// Check for migration | 55 | /// <item>Loads and initialises the MySQL storage plugin</item> |
56 | /// <item>warns and uses the obsolete mysql_connection.ini if connect string is empty.</item> | ||
57 | /// <item>Check for migration</item> | ||
58 | /// </list> | ||
59 | /// </para> | ||
56 | /// </summary> | 60 | /// </summary> |
57 | /// <param name="connect">connect string.</param> | 61 | /// <param name="connect">connect string</param> |
58 | public void Initialise(string connect) | 62 | public void Initialise(string connect) |
59 | { | 63 | { |
60 | if (connect != String.Empty) | 64 | if (connect != String.Empty) |
@@ -90,6 +94,13 @@ namespace OpenSim.Data.MySQL | |||
90 | 94 | ||
91 | #region Test and initialization code | 95 | #region Test and initialization code |
92 | 96 | ||
97 | /// <summary> | ||
98 | /// <list type="bullet"> | ||
99 | /// <item>Execute CreateFoldersTable.sql if oldVersion == null</item> | ||
100 | /// <item>do nothing if oldVersion != null</item> | ||
101 | /// </list> | ||
102 | /// </summary> | ||
103 | /// <param name="oldVersion"></param> | ||
93 | private void UpgradeFoldersTable(string oldVersion) | 104 | private void UpgradeFoldersTable(string oldVersion) |
94 | { | 105 | { |
95 | // null as the version, indicates that the table didn't exist | 106 | // null as the version, indicates that the table didn't exist |
@@ -99,13 +110,19 @@ namespace OpenSim.Data.MySQL | |||
99 | return; | 110 | return; |
100 | } | 111 | } |
101 | 112 | ||
102 | // if the table is already at the current version, then we can exit immediately | 113 | //// if the table is already at the current version, then we can exit immediately |
103 | // if (oldVersion == "Rev. 2") | 114 | // if (oldVersion == "Rev. 2") |
104 | // return; | 115 | // return; |
105 | 116 | // database.ExecuteResourceSql("UpgradeFoldersTableToVersion2.sql"); | |
106 | // database.ExecuteResourceSql("UpgradeFoldersTableToVersion2.sql"); | ||
107 | } | 117 | } |
108 | 118 | ||
119 | /// <summary> | ||
120 | /// <list type="bullet"> | ||
121 | /// <item>Execute CreateItemsTable.sql if oldVersion == null</item> | ||
122 | /// <item>Execute "UpgradeItemsTableToVersion3.sql" if oldVersion start with "Rev. 2;"</item> | ||
123 | /// </list> | ||
124 | /// </summary> | ||
125 | /// <param name="oldVersion"></param> | ||
109 | private void UpgradeItemsTable(string oldVersion) | 126 | private void UpgradeItemsTable(string oldVersion) |
110 | { | 127 | { |
111 | // null as the version, indicates that the table didn't exist | 128 | // null as the version, indicates that the table didn't exist |
@@ -123,6 +140,11 @@ namespace OpenSim.Data.MySQL | |||
123 | } | 140 | } |
124 | } | 141 | } |
125 | 142 | ||
143 | /// <summary> | ||
144 | /// | ||
145 | /// </summary> | ||
146 | /// <param name="conn">MySQL connection handler</param> | ||
147 | /// <param name="m"></param> | ||
126 | private void TestTables(MySqlConnection conn, Migration m) | 148 | private void TestTables(MySqlConnection conn, Migration m) |
127 | { | 149 | { |
128 | Dictionary<string, string> tableList = new Dictionary<string, string>(); | 150 | Dictionary<string, string> tableList = new Dictionary<string, string>(); |
@@ -178,7 +200,7 @@ namespace OpenSim.Data.MySQL | |||
178 | /// <summary> | 200 | /// <summary> |
179 | /// Returns the version of this DB provider | 201 | /// Returns the version of this DB provider |
180 | /// </summary> | 202 | /// </summary> |
181 | /// <returns>A string containing the DB provider</returns> | 203 | /// <returns>A string containing the DB provider version</returns> |
182 | public string getVersion() | 204 | public string getVersion() |
183 | { | 205 | { |
184 | return database.getVersion(); | 206 | return database.getVersion(); |
@@ -260,9 +282,9 @@ namespace OpenSim.Data.MySQL | |||
260 | 282 | ||
261 | 283 | ||
262 | /// <summary> | 284 | /// <summary> |
263 | /// see InventoryItemBase.getUserRootFolder | 285 | /// see <see cref="InventoryItemBase.getUserRootFolder"/> |
264 | /// </summary> | 286 | /// </summary> |
265 | /// <param name="user"></param> | 287 | /// <param name="user">The user UUID</param> |
266 | /// <returns></returns> | 288 | /// <returns></returns> |
267 | public InventoryFolderBase getUserRootFolder(LLUUID user) | 289 | public InventoryFolderBase getUserRootFolder(LLUUID user) |
268 | { | 290 | { |
@@ -545,9 +567,9 @@ namespace OpenSim.Data.MySQL | |||
545 | } | 567 | } |
546 | 568 | ||
547 | /// <summary> | 569 | /// <summary> |
548 | /// | 570 | /// Detele the specified inventory item |
549 | /// </summary> | 571 | /// </summary> |
550 | /// <param name="item"></param> | 572 | /// <param name="item">The inventory item UUID to delete</param> |
551 | public void deleteInventoryItem(LLUUID itemID) | 573 | public void deleteInventoryItem(LLUUID itemID) |
552 | { | 574 | { |
553 | try | 575 | try |
@@ -609,9 +631,10 @@ namespace OpenSim.Data.MySQL | |||
609 | } | 631 | } |
610 | 632 | ||
611 | /// <summary> | 633 | /// <summary> |
612 | /// Creates a new inventory folder | 634 | /// Move an inventory folder |
613 | /// </summary> | 635 | /// </summary> |
614 | /// <param name="folder">Folder to create</param> | 636 | /// <param name="folder">Folder to move</param> |
637 | /// <remarks>UPDATE inventoryfolders SET parentFolderID=?parentFolderID WHERE folderID=?folderID</remarks> | ||
615 | public void moveInventoryFolder(InventoryFolderBase folder) | 638 | public void moveInventoryFolder(InventoryFolderBase folder) |
616 | { | 639 | { |
617 | string sql = | 640 | string sql = |