From bc515c324140ee9770ec5c6e2b960014b1e66be0 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Fri, 10 Apr 2009 11:34:37 +0000
Subject: * Apply http://opensimulator.org/mantis/view.php?id=3439 * This
 corrects problems seen on some SQLite systems where the migration fails
 because the two argument substr() isn't implemented * Thanks RemedyTomm!

---
 OpenSim/Data/SQLite/Resources/004_InventoryStore.sql | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

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

diff --git a/OpenSim/Data/SQLite/Resources/004_InventoryStore.sql b/OpenSim/Data/SQLite/Resources/004_InventoryStore.sql
index f640f80..e8f4d46 100644
--- a/OpenSim/Data/SQLite/Resources/004_InventoryStore.sql
+++ b/OpenSim/Data/SQLite/Resources/004_InventoryStore.sql
@@ -1,36 +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)
+  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) 
+  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) 
+  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) 
+  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)
+  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)
+  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)
+  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)
+  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

