From 07609565617aa7936758acba5fd625877564a10d Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Thu, 19 Feb 2009 18:09:10 +0000
Subject: * Apply http://opensimulator.org/mantis/view.php?id=3142 * Changes
 varchar(36) columns to UUID type in MSSQL - this will be much more efficient
 * ===As always, please, please backup your database before applying this
 patch=== * Thanks Ruud Lathrop (for the patch) and StrawberryFride (for the
 review)

---
 OpenSim/Data/MSSQL/Resources/005_EstateStore.sql | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 OpenSim/Data/MSSQL/Resources/005_EstateStore.sql

(limited to 'OpenSim/Data/MSSQL/Resources/005_EstateStore.sql')

diff --git a/OpenSim/Data/MSSQL/Resources/005_EstateStore.sql b/OpenSim/Data/MSSQL/Resources/005_EstateStore.sql
new file mode 100644
index 0000000..ba93b39
--- /dev/null
+++ b/OpenSim/Data/MSSQL/Resources/005_EstateStore.sql
@@ -0,0 +1,22 @@
+BEGIN TRANSACTION
+
+CREATE TABLE dbo.Tmp_estate_groups
+	(
+	EstateID int NOT NULL,
+	uuid uniqueidentifier NOT NULL
+	)  ON [PRIMARY]
+
+IF EXISTS(SELECT * FROM dbo.estate_groups)
+	 EXEC('INSERT INTO dbo.Tmp_estate_groups (EstateID, uuid)
+		SELECT EstateID, CONVERT(uniqueidentifier, uuid) FROM dbo.estate_groups WITH (HOLDLOCK TABLOCKX)')
+
+DROP TABLE dbo.estate_groups
+
+EXECUTE sp_rename N'dbo.Tmp_estate_groups', N'estate_groups', 'OBJECT' 
+
+CREATE NONCLUSTERED INDEX IX_estate_groups ON dbo.estate_groups
+	(
+	EstateID
+	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+
+COMMIT
-- 
cgit v1.1

