aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/Resources/004_UserStore.sql
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/MSSQL/Resources/004_UserStore.sql')
-rw-r--r--OpenSim/Data/MSSQL/Resources/004_UserStore.sql58
1 files changed, 58 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/Resources/004_UserStore.sql b/OpenSim/Data/MSSQL/Resources/004_UserStore.sql
new file mode 100644
index 0000000..f3e223e
--- /dev/null
+++ b/OpenSim/Data/MSSQL/Resources/004_UserStore.sql
@@ -0,0 +1,58 @@
1BEGIN TRANSACTION
2
3CREATE TABLE Tmp_userfriends
4 (
5 ownerID varchar(36) NOT NULL,
6 friendID varchar(36) NOT NULL,
7 friendPerms int NOT NULL,
8 datetimestamp int NOT NULL
9 ) ON [PRIMARY]
10
11IF EXISTS(SELECT * FROM userfriends)
12 EXEC('INSERT INTO dbo.Tmp_userfriends (ownerID, friendID, friendPerms, datetimestamp)
13 SELECT CONVERT(varchar(36), ownerID), CONVERT(varchar(36), friendID), CONVERT(int, friendPerms), CONVERT(int, datetimestamp) FROM dbo.userfriends WITH (HOLDLOCK TABLOCKX)')
14
15DROP TABLE dbo.userfriends
16
17EXECUTE sp_rename N'Tmp_userfriends', N'userfriends', 'OBJECT'
18
19CREATE NONCLUSTERED INDEX IX_userfriends_ownerID ON 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 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
30BEGIN TRANSACTION
31
32CREATE TABLE Tmp_userfriends
33 (
34 ownerID varchar(36) NOT NULL,
35 friendID varchar(36) NOT NULL,
36 friendPerms int NOT NULL,
37 datetimestamp int NOT NULL
38 ) ON [PRIMARY]
39
40IF EXISTS(SELECT * FROM dbo.userfriends)
41 EXEC('INSERT INTO dbo.Tmp_userfriends (ownerID, friendID, friendPerms, datetimestamp)
42 SELECT CONVERT(varchar(36), ownerID), CONVERT(varchar(36), friendID), CONVERT(int, friendPerms), CONVERT(int, datetimestamp) FROM dbo.userfriends WITH (HOLDLOCK TABLOCKX)')
43
44DROP TABLE dbo.userfriends
45
46EXECUTE sp_rename N'Tmp_userfriends', N'userfriends', 'OBJECT'
47
48CREATE NONCLUSTERED INDEX IX_userfriends_ownerID ON userfriends
49 (
50 ownerID
51 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
52
53CREATE NONCLUSTERED INDEX IX_userfriends_friendID ON userfriends
54 (
55 friendID
56 ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
57
58COMMIT