From 62bc9c2e8ec75c85cab7358205691d8d61df7e26 Mon Sep 17 00:00:00 2001
From: Charles Krinke
Date: Sun, 9 Nov 2008 00:53:54 +0000
Subject: Mantis#2591. Thank you kindly, Ruud Lathrop for a patch that: This
 patch is two script that fixes a issue when adding more then 1 avatar to
 estateban/estatemanager list. It removes a key and adds a index to the
 tables.

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

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

diff --git a/OpenSim/Data/MSSQL/Resources/003_EstateStore.sql b/OpenSim/Data/MSSQL/Resources/003_EstateStore.sql
new file mode 100644
index 0000000..7dd0ec8
--- /dev/null
+++ b/OpenSim/Data/MSSQL/Resources/003_EstateStore.sql
@@ -0,0 +1,25 @@
+BEGIN TRANSACTION
+
+CREATE TABLE dbo.Tmp_estateban
+	(
+	EstateID int NOT NULL,
+	bannedUUID varchar(36) NOT NULL,
+	bannedIp varchar(16) NULL,
+	bannedIpHostMask varchar(16) NULL,
+	bannedNameMask varchar(64) NULL
+	)  ON [PRIMARY]
+
+IF EXISTS(SELECT * FROM dbo.estateban)
+	 EXEC('INSERT INTO dbo.Tmp_estateban (EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask)
+		SELECT EstateID, bannedUUID, bannedIp, bannedIpHostMask, bannedNameMask FROM dbo.estateban')
+
+DROP TABLE dbo.estateban
+
+EXECUTE sp_rename N'dbo.Tmp_estateban', N'estateban', 'OBJECT' 
+
+CREATE NONCLUSTERED INDEX IX_estateban ON dbo.estateban
+	(
+	EstateID
+	) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
+
+COMMIT
-- 
cgit v1.1

