diff options
author | AlexRa | 2010-05-06 23:16:36 +0300 |
---|---|---|
committer | AlexRa | 2010-05-16 17:04:50 +0300 |
commit | dfeb9a0b5c07a85ec8aed591206468cee83ce637 (patch) | |
tree | 412dbee487945ed78c9d2598d2310a02c411ef96 /OpenSim/Data/MSSQL/Resources/GridStore.migrations | |
parent | Migrations for SQLite converted to new format (diff) | |
download | opensim-SC-dfeb9a0b5c07a85ec8aed591206468cee83ce637.zip opensim-SC-dfeb9a0b5c07a85ec8aed591206468cee83ce637.tar.gz opensim-SC-dfeb9a0b5c07a85ec8aed591206468cee83ce637.tar.bz2 opensim-SC-dfeb9a0b5c07a85ec8aed591206468cee83ce637.tar.xz |
MS SQL migrations converted to the new format
Diffstat (limited to 'OpenSim/Data/MSSQL/Resources/GridStore.migrations')
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/GridStore.migrations | 225 |
1 files changed, 225 insertions, 0 deletions
diff --git a/OpenSim/Data/MSSQL/Resources/GridStore.migrations b/OpenSim/Data/MSSQL/Resources/GridStore.migrations new file mode 100644 index 0000000..d2ca27a --- /dev/null +++ b/OpenSim/Data/MSSQL/Resources/GridStore.migrations | |||
@@ -0,0 +1,225 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | BEGIN TRANSACTION | ||
4 | |||
5 | CREATE TABLE [dbo].[regions]( | ||
6 | [regionHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
7 | [regionName] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
8 | [uuid] [varchar](255) COLLATE Latin1_General_CI_AS NOT NULL, | ||
9 | [regionRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
10 | [regionSecret] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
11 | [regionSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
12 | [regionDataURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
13 | [serverIP] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
14 | [serverPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
15 | [serverURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
16 | [locX] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
17 | [locY] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
18 | [locZ] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
19 | [eastOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
20 | [westOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
21 | [southOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
22 | [northOverrideHandle] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
23 | [regionAssetURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
24 | [regionAssetRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
25 | [regionAssetSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
26 | [regionUserURI] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
27 | [regionUserRecvKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
28 | [regionUserSendKey] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
29 | [regionMapTexture] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
30 | [serverHttpPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
31 | [serverRemotingPort] [varchar](255) COLLATE Latin1_General_CI_AS NULL, | ||
32 | [owner_uuid] [varchar](36) COLLATE Latin1_General_CI_AS NULL, | ||
33 | PRIMARY KEY CLUSTERED | ||
34 | ( | ||
35 | [uuid] ASC | ||
36 | )WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY] | ||
37 | ) ON [PRIMARY] | ||
38 | |||
39 | COMMIT | ||
40 | |||
41 | |||
42 | :VERSION 2 | ||
43 | |||
44 | BEGIN TRANSACTION | ||
45 | |||
46 | CREATE TABLE Tmp_regions | ||
47 | ( | ||
48 | uuid varchar(36) COLLATE Latin1_General_CI_AS NOT NULL, | ||
49 | regionHandle bigint NULL, | ||
50 | regionName varchar(20) NULL, | ||
51 | regionRecvKey varchar(128) NULL, | ||
52 | regionSendKey varchar(128) NULL, | ||
53 | regionSecret varchar(128) NULL, | ||
54 | regionDataURI varchar(128) NULL, | ||
55 | serverIP varchar(64) NULL, | ||
56 | serverPort int NULL, | ||
57 | serverURI varchar(255) NULL, | ||
58 | locX int NULL, | ||
59 | locY int NULL, | ||
60 | locZ int NULL, | ||
61 | eastOverrideHandle bigint NULL, | ||
62 | westOverrideHandle bigint NULL, | ||
63 | southOverrideHandle bigint NULL, | ||
64 | northOverrideHandle bigint NULL, | ||
65 | regionAssetURI varchar(255) NULL, | ||
66 | regionAssetRecvKey varchar(128) NULL, | ||
67 | regionAssetSendKey varchar(128) NULL, | ||
68 | regionUserURI varchar(255) NULL, | ||
69 | regionUserRecvKey varchar(128) NULL, | ||
70 | regionUserSendKey varchar(128) NULL, | ||
71 | regionMapTexture varchar(36) NULL, | ||
72 | serverHttpPort int NULL, | ||
73 | serverRemotingPort int NULL, | ||
74 | owner_uuid varchar(36) NULL, | ||
75 | originUUID varchar(36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000') | ||
76 | ) ON [PRIMARY] | ||
77 | |||
78 | IF EXISTS(SELECT * FROM regions) | ||
79 | EXEC('INSERT INTO Tmp_regions (uuid, regionHandle, regionName, regionRecvKey, regionSendKey, regionSecret, regionDataURI, serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture, serverHttpPort, serverRemotingPort, owner_uuid) | ||
80 | SELECT CONVERT(varchar(36), uuid), CONVERT(bigint, regionHandle), CONVERT(varchar(20), regionName), CONVERT(varchar(128), regionRecvKey), CONVERT(varchar(128), regionSendKey), CONVERT(varchar(128), regionSecret), CONVERT(varchar(128), regionDataURI), CONVERT(varchar(64), serverIP), CONVERT(int, serverPort), serverURI, CONVERT(int, locX), CONVERT(int, locY), CONVERT(int, locZ), CONVERT(bigint, eastOverrideHandle), CONVERT(bigint, westOverrideHandle), CONVERT(bigint, southOverrideHandle), CONVERT(bigint, northOverrideHandle), regionAssetURI, CONVERT(varchar(128), regionAssetRecvKey), CONVERT(varchar(128), regionAssetSendKey), regionUserURI, CONVERT(varchar(128), regionUserRecvKey), CONVERT(varchar(128), regionUserSendKey), CONVERT(varchar(36), regionMapTexture), CONVERT(int, serverHttpPort), CONVERT(int, serverRemotingPort), owner_uuid FROM regions') | ||
81 | |||
82 | DROP TABLE regions | ||
83 | |||
84 | EXECUTE sp_rename N'Tmp_regions', N'regions', 'OBJECT' | ||
85 | |||
86 | ALTER TABLE regions ADD CONSTRAINT | ||
87 | PK__regions__uuid PRIMARY KEY CLUSTERED | ||
88 | ( | ||
89 | uuid | ||
90 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
91 | |||
92 | COMMIT | ||
93 | |||
94 | :VERSION 3 | ||
95 | |||
96 | BEGIN TRANSACTION | ||
97 | |||
98 | CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions | ||
99 | ( | ||
100 | regionName | ||
101 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
102 | |||
103 | CREATE NONCLUSTERED INDEX IX_regions_handle ON dbo.regions | ||
104 | ( | ||
105 | regionHandle | ||
106 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
107 | |||
108 | |||
109 | CREATE NONCLUSTERED INDEX IX_regions_override ON dbo.regions | ||
110 | ( | ||
111 | eastOverrideHandle, | ||
112 | westOverrideHandle, | ||
113 | southOverrideHandle, | ||
114 | northOverrideHandle | ||
115 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
116 | |||
117 | COMMIT | ||
118 | |||
119 | |||
120 | :VERSION 4 | ||
121 | |||
122 | /* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/ | ||
123 | BEGIN TRANSACTION | ||
124 | |||
125 | CREATE TABLE dbo.Tmp_regions | ||
126 | ( | ||
127 | uuid uniqueidentifier NOT NULL, | ||
128 | regionHandle bigint NULL, | ||
129 | regionName varchar(20) NULL, | ||
130 | regionRecvKey varchar(128) NULL, | ||
131 | regionSendKey varchar(128) NULL, | ||
132 | regionSecret varchar(128) NULL, | ||
133 | regionDataURI varchar(128) NULL, | ||
134 | serverIP varchar(64) NULL, | ||
135 | serverPort int NULL, | ||
136 | serverURI varchar(255) NULL, | ||
137 | locX int NULL, | ||
138 | locY int NULL, | ||
139 | locZ int NULL, | ||
140 | eastOverrideHandle bigint NULL, | ||
141 | westOverrideHandle bigint NULL, | ||
142 | southOverrideHandle bigint NULL, | ||
143 | northOverrideHandle bigint NULL, | ||
144 | regionAssetURI varchar(255) NULL, | ||
145 | regionAssetRecvKey varchar(128) NULL, | ||
146 | regionAssetSendKey varchar(128) NULL, | ||
147 | regionUserURI varchar(255) NULL, | ||
148 | regionUserRecvKey varchar(128) NULL, | ||
149 | regionUserSendKey varchar(128) NULL, | ||
150 | regionMapTexture uniqueidentifier NULL, | ||
151 | serverHttpPort int NULL, | ||
152 | serverRemotingPort int NULL, | ||
153 | owner_uuid uniqueidentifier NOT NULL, | ||
154 | originUUID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000') | ||
155 | ) ON [PRIMARY] | ||
156 | |||
157 | IF EXISTS(SELECT * FROM dbo.regions) | ||
158 | EXEC('INSERT INTO dbo.Tmp_regions (uuid, regionHandle, regionName, regionRecvKey, regionSendKey, regionSecret, regionDataURI, serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, regionMapTexture, serverHttpPort, serverRemotingPort, owner_uuid, originUUID) | ||
159 | SELECT CONVERT(uniqueidentifier, uuid), regionHandle, regionName, regionRecvKey, regionSendKey, regionSecret, regionDataURI, serverIP, serverPort, serverURI, locX, locY, locZ, eastOverrideHandle, westOverrideHandle, southOverrideHandle, northOverrideHandle, regionAssetURI, regionAssetRecvKey, regionAssetSendKey, regionUserURI, regionUserRecvKey, regionUserSendKey, CONVERT(uniqueidentifier, regionMapTexture), serverHttpPort, serverRemotingPort, CONVERT(uniqueidentifier, owner_uuid), CONVERT(uniqueidentifier, originUUID) FROM dbo.regions WITH (HOLDLOCK TABLOCKX)') | ||
160 | |||
161 | DROP TABLE dbo.regions | ||
162 | |||
163 | EXECUTE sp_rename N'dbo.Tmp_regions', N'regions', 'OBJECT' | ||
164 | |||
165 | ALTER TABLE dbo.regions ADD CONSTRAINT | ||
166 | PK__regions__uuid PRIMARY KEY CLUSTERED | ||
167 | ( | ||
168 | uuid | ||
169 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
170 | |||
171 | CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions | ||
172 | ( | ||
173 | regionName | ||
174 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
175 | |||
176 | CREATE NONCLUSTERED INDEX IX_regions_handle ON dbo.regions | ||
177 | ( | ||
178 | regionHandle | ||
179 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
180 | |||
181 | CREATE NONCLUSTERED INDEX IX_regions_override ON dbo.regions | ||
182 | ( | ||
183 | eastOverrideHandle, | ||
184 | westOverrideHandle, | ||
185 | southOverrideHandle, | ||
186 | northOverrideHandle | ||
187 | ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] | ||
188 | |||
189 | COMMIT | ||
190 | |||
191 | |||
192 | :VERSION 5 | ||
193 | |||
194 | BEGIN TRANSACTION | ||
195 | |||
196 | ALTER TABLE regions ADD access int default 0; | ||
197 | |||
198 | COMMIT | ||
199 | |||
200 | |||
201 | :VERSION 6 | ||
202 | |||
203 | BEGIN TRANSACTION | ||
204 | |||
205 | ALTER TABLE regions ADD scopeid uniqueidentifier default '00000000-0000-0000-0000-000000000000'; | ||
206 | ALTER TABLE regions ADD DEFAULT ('00000000-0000-0000-0000-000000000000') FOR [owner_uuid]; | ||
207 | ALTER TABLE regions ADD sizeX integer not null default 0; | ||
208 | ALTER TABLE regions ADD sizeY integer not null default 0; | ||
209 | |||
210 | COMMIT | ||
211 | |||
212 | |||
213 | :VERSION 7 | ||
214 | |||
215 | BEGIN TRANSACTION | ||
216 | |||
217 | ALTER TABLE regions ADD [flags] integer NOT NULL DEFAULT 0; | ||
218 | CREATE INDEX [flags] ON regions(flags); | ||
219 | ALTER TABLE [regions] ADD [last_seen] integer NOT NULL DEFAULT 0; | ||
220 | ALTER TABLE [regions] ADD [PrincipalID] uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; | ||
221 | ALTER TABLE [regions] ADD [Token] varchar(255) NOT NULL DEFAULT 0; | ||
222 | |||
223 | COMMIT | ||
224 | |||
225 | |||