From a23bebdc0f106c19de09e54d88eebc6b086fdaab Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 23 Apr 2010 17:17:15 +0100
Subject: Duplicate OpenSim.Data.SQLite into OpenSim.Data.SQLiteNG.  SQLiteNG
 will shortly be changed to work under mono 2.6 and above

---
 .../Data/SQLiteNG/Resources/004_InventoryStore.sql | 36 ++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 OpenSim/Data/SQLiteNG/Resources/004_InventoryStore.sql

(limited to 'OpenSim/Data/SQLiteNG/Resources/004_InventoryStore.sql')

diff --git a/OpenSim/Data/SQLiteNG/Resources/004_InventoryStore.sql b/OpenSim/Data/SQLiteNG/Resources/004_InventoryStore.sql
new file mode 100644
index 0000000..e8f4d46
--- /dev/null
+++ b/OpenSim/Data/SQLiteNG/Resources/004_InventoryStore.sql
@@ -0,0 +1,36 @@
+BEGIN;
+
+update inventoryitems 
+  set UUID = substr(UUID, 1, 8) || "-" || substr(UUID, 9, 4) || "-" || substr(UUID, 13, 4) || "-" || substr(UUID, 17, 4) || "-" || substr(UUID, 21, 12)
+  where UUID not like '%-%';
+
+update inventoryitems
+  set assetID = substr(assetID, 1, 8) || "-" || substr(assetID, 9, 4) || "-" || substr(assetID, 13, 4) || "-" || substr(assetID, 17, 4) || "-" || substr(assetID, 21, 12) 
+  where assetID not like '%-%';
+
+update inventoryitems
+  set parentFolderID = substr(parentFolderID, 1, 8) || "-" || substr(parentFolderID, 9, 4) || "-" || substr(parentFolderID, 13, 4) || "-" || substr(parentFolderID, 17, 4) || "-" || substr(parentFolderID, 21, 12) 
+  where parentFolderID not like '%-%';
+
+update inventoryitems
+  set avatarID = substr(avatarID, 1, 8) || "-" || substr(avatarID, 9, 4) || "-" || substr(avatarID, 13, 4) || "-" || substr(avatarID, 17, 4) || "-" || substr(avatarID, 21, 12) 
+  where avatarID not like '%-%';
+
+update inventoryitems
+  set creatorsID = substr(creatorsID, 1, 8) || "-" || substr(creatorsID, 9, 4) || "-" || substr(creatorsID, 13, 4) || "-" || substr(creatorsID, 17, 4) || "-" || substr(creatorsID, 21, 12)
+  where creatorsID not like '%-%';
+
+
+update inventoryfolders
+  set UUID = substr(UUID, 1, 8) || "-" || substr(UUID, 9, 4) || "-" || substr(UUID, 13, 4) || "-" || substr(UUID, 17, 4) || "-" || substr(UUID, 21, 12)
+  where UUID not like '%-%';
+
+update inventoryfolders
+  set agentID = substr(agentID, 1, 8) || "-" || substr(agentID, 9, 4) || "-" || substr(agentID, 13, 4) || "-" || substr(agentID, 17, 4) || "-" || substr(agentID, 21, 12)
+  where agentID not like '%-%';
+
+update inventoryfolders
+  set parentID = substr(parentID, 1, 8) || "-" || substr(parentID, 9, 4) || "-" || substr(parentID, 13, 4) || "-" || substr(parentID, 17, 4) || "-" || substr(parentID, 21, 12)
+  where parentID not like '%-%';
+
+COMMIT;
-- 
cgit v1.1

