diff options
Diffstat (limited to 'OpenSim/Data/MSSQL/Resources/007_UserStore.sql')
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/007_UserStore.sql | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/Resources/007_UserStore.sql b/OpenSim/Data/MSSQL/Resources/007_UserStore.sql new file mode 100644 index 0000000..92a8fc5 --- /dev/null +++ b/OpenSim/Data/MSSQL/Resources/007_UserStore.sql | |||
@@ -0,0 +1,42 @@ | |||
1 | BEGIN TRANSACTION | ||
2 | |||
3 | CREATE TABLE dbo.Tmp_agents | ||
4 | ( | ||
5 | UUID uniqueidentifier NOT NULL, | ||
6 | sessionID uniqueidentifier NOT NULL, | ||
7 | secureSessionID uniqueidentifier NOT NULL, | ||
8 | agentIP varchar(16) NOT NULL, | ||
9 | agentPort int NOT NULL, | ||
10 | agentOnline tinyint NOT NULL, | ||
11 | loginTime int NOT NULL, | ||
12 | logoutTime int NOT NULL, | ||
13 | currentRegion uniqueidentifier NOT NULL, | ||
14 | currentHandle bigint NOT NULL, | ||
15 | currentPos varchar(64) NOT NULL | ||
16 | ) ON [PRIMARY] | ||
17 | |||
18 | IF EXISTS(SELECT * FROM dbo.agents) | ||
19 | EXEC('INSERT INTO dbo.Tmp_agents (UUID, sessionID, secureSessionID, agentIP, agentPort, agentOnline, loginTime, logoutTime, currentRegion, currentHandle, currentPos) | ||
20 | SELECT CONVERT(uniqueidentifier, UUID), CONVERT(uniqueidentifier, sessionID), CONVERT(uniqueidentifier, secureSessionID), agentIP, agentPort, agentOnline, loginTime, logoutTime, CONVERT(uniqueidentifier, currentRegion), currentHandle, currentPos FROM dbo.agents WITH (HOLDLOCK TABLOCKX)') | ||
21 | |||
22 | DROP TABLE dbo.agents | ||
23 | |||
24 | EXECUTE sp_rename N'dbo.Tmp_agents', N'agents', 'OBJECT' | ||
25 | |||
26 | ALTER TABLE dbo.agents ADD CONSTRAINT | ||
27 | PK__agents__65A475E749C3F6B7 PRIMARY KEY CLUSTERED | ||
28 | ( | ||
29 | UUID | ||
30 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
31 | |||
32 | CREATE NONCLUSTERED INDEX session ON dbo.agents | ||
33 | ( | ||
34 | sessionID | ||
35 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
36 | |||
37 | CREATE NONCLUSTERED INDEX ssession ON dbo.agents | ||
38 | ( | ||
39 | secureSessionID | ||
40 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
41 | |||
42 | COMMIT | ||