aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/Resources/008_UserStore.sql
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MSSQL/Resources/008_UserStore.sql')
-rw-r--r--OpenSim/Data/MSSQL/Resources/008_UserStore.sql29
1 files changed, 29 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/Resources/008_UserStore.sql b/OpenSim/Data/MSSQL/Resources/008_UserStore.sql
new file mode 100644
index 0000000..505252b
--- /dev/null
+++ b/OpenSim/Data/MSSQL/Resources/008_UserStore.sql
@@ -0,0 +1,29 @@
1BEGIN TRANSACTION
2
3CREATE TABLE dbo.Tmp_userfriends
4 (
5 ownerID uniqueidentifier NOT NULL,
6 friendID uniqueidentifier NOT NULL,
7 friendPerms int NOT NULL,
8 datetimestamp int NOT NULL
9 ) ON [PRIMARY]
10
11IF EXISTS(SELECT * FROM dbo.userfriends)
12 EXEC('INSERT INTO dbo.Tmp_userfriends (ownerID, friendID, friendPerms, datetimestamp)
13 SELECT CONVERT(uniqueidentifier, ownerID), CONVERT(uniqueidentifier, friendID), friendPerms, datetimestamp FROM dbo.userfriends WITH (HOLDLOCK TABLOCKX)')
14
15DROP TABLE dbo.userfriends
16
17EXECUTE sp_rename N'dbo.Tmp_userfriends', N'userfriends', 'OBJECT'
18
19CREATE NONCLUSTERED INDEX IX_userfriends_ownerID ON dbo.userfriends
20 (
21 ownerID
22 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
23
24CREATE NONCLUSTERED INDEX IX_userfriends_friendID ON dbo.userfriends
25 (
26 friendID
27 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
28
29COMMIT