1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
|
:VERSION 1
BEGIN TRANSACTION
CREATE TABLE [dbo].[estate_managers](
[EstateID] [int] NOT NULL,
[uuid] [varchar](36) NOT NULL,
CONSTRAINT [PK_estate_managers] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estate_groups](
[EstateID] [int] NOT NULL,
[uuid] [varchar](36) NOT NULL,
CONSTRAINT [PK_estate_groups] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estate_users](
[EstateID] [int] NOT NULL,
[uuid] [varchar](36) NOT NULL,
CONSTRAINT [PK_estate_users] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estateban](
[EstateID] [int] NOT NULL,
[bannedUUID] [varchar](36) NOT NULL,
[bannedIp] [varchar](16) NOT NULL,
[bannedIpHostMask] [varchar](16) NOT NULL,
[bannedNameMask] [varchar](64) NULL DEFAULT (NULL),
CONSTRAINT [PK_estateban] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estate_settings](
[EstateID] [int] IDENTITY(1,100) NOT NULL,
[EstateName] [varchar](64) NULL DEFAULT (NULL),
[AbuseEmailToEstateOwner] [bit] NOT NULL,
[DenyAnonymous] [bit] NOT NULL,
[ResetHomeOnTeleport] [bit] NOT NULL,
[FixedSun] [bit] NOT NULL,
[DenyTransacted] [bit] NOT NULL,
[BlockDwell] [bit] NOT NULL,
[DenyIdentified] [bit] NOT NULL,
[AllowVoice] [bit] NOT NULL,
[UseGlobalTime] [bit] NOT NULL,
[PricePerMeter] [int] NOT NULL,
[TaxFree] [bit] NOT NULL,
[AllowDirectTeleport] [bit] NOT NULL,
[RedirectGridX] [int] NOT NULL,
[RedirectGridY] [int] NOT NULL,
[ParentEstateID] [int] NOT NULL,
[SunPosition] [float] NOT NULL,
[EstateSkipScripts] [bit] NOT NULL,
[BillableFactor] [float] NOT NULL,
[PublicAccess] [bit] NOT NULL,
[AbuseEmail] [varchar](255) NOT NULL,
[EstateOwner] [varchar](36) NOT NULL,
[DenyMinors] [bit] NOT NULL,
CONSTRAINT [PK_estate_settings] PRIMARY KEY CLUSTERED
(
[EstateID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
CREATE TABLE [dbo].[estate_map](
[RegionID] [varchar](36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
[EstateID] [int] NOT NULL,
CONSTRAINT [PK_estate_map] PRIMARY KEY CLUSTERED
(
[RegionID] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY];
COMMIT
:VERSION 2
BEGIN TRANSACTION
ALTER TABLE dbo.estate_managers DROP CONSTRAINT PK_estate_managers
CREATE NONCLUSTERED INDEX IX_estate_managers ON dbo.estate_managers
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
ALTER TABLE dbo.estate_groups DROP CONSTRAINT PK_estate_groups
CREATE NONCLUSTERED INDEX IX_estate_groups ON dbo.estate_groups
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
ALTER TABLE dbo.estate_users DROP CONSTRAINT PK_estate_users
CREATE NONCLUSTERED INDEX IX_estate_users ON dbo.estate_users
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 3
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
:VERSION 4
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_managers
(
EstateID int NOT NULL,
uuid uniqueidentifier NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estate_managers)
EXEC('INSERT INTO dbo.Tmp_estate_managers (EstateID, uuid)
SELECT EstateID, CONVERT(uniqueidentifier, uuid) FROM dbo.estate_managers WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.estate_managers
EXECUTE sp_rename N'dbo.Tmp_estate_managers', N'estate_managers', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_estate_managers ON dbo.estate_managers
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 5
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_groups
(
EstateID int NOT NULL,
uuid uniqueidentifier NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estate_groups)
EXEC('INSERT INTO dbo.Tmp_estate_groups (EstateID, uuid)
SELECT EstateID, CONVERT(uniqueidentifier, uuid) FROM dbo.estate_groups WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.estate_groups
EXECUTE sp_rename N'dbo.Tmp_estate_groups', N'estate_groups', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_estate_groups ON dbo.estate_groups
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 6
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_users
(
EstateID int NOT NULL,
uuid uniqueidentifier NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estate_users)
EXEC('INSERT INTO dbo.Tmp_estate_users (EstateID, uuid)
SELECT EstateID, CONVERT(uniqueidentifier, uuid) FROM dbo.estate_users WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.estate_users
EXECUTE sp_rename N'dbo.Tmp_estate_users', N'estate_users', 'OBJECT'
CREATE NONCLUSTERED INDEX IX_estate_users ON dbo.estate_users
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 7
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estateban
(
EstateID int NOT NULL,
bannedUUID uniqueidentifier 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, CONVERT(uniqueidentifier, bannedUUID), bannedIp, bannedIpHostMask, bannedNameMask FROM dbo.estateban WITH (HOLDLOCK TABLOCKX)')
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
:VERSION 8
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_settings
(
EstateID int NOT NULL IDENTITY (1, 100),
EstateName varchar(64) NULL DEFAULT (NULL),
AbuseEmailToEstateOwner bit NOT NULL,
DenyAnonymous bit NOT NULL,
ResetHomeOnTeleport bit NOT NULL,
FixedSun bit NOT NULL,
DenyTransacted bit NOT NULL,
BlockDwell bit NOT NULL,
DenyIdentified bit NOT NULL,
AllowVoice bit NOT NULL,
UseGlobalTime bit NOT NULL,
PricePerMeter int NOT NULL,
TaxFree bit NOT NULL,
AllowDirectTeleport bit NOT NULL,
RedirectGridX int NOT NULL,
RedirectGridY int NOT NULL,
ParentEstateID int NOT NULL,
SunPosition float(53) NOT NULL,
EstateSkipScripts bit NOT NULL,
BillableFactor float(53) NOT NULL,
PublicAccess bit NOT NULL,
AbuseEmail varchar(255) NOT NULL,
EstateOwner uniqueidentifier NOT NULL,
DenyMinors bit NOT NULL
) ON [PRIMARY]
SET IDENTITY_INSERT dbo.Tmp_estate_settings ON
IF EXISTS(SELECT * FROM dbo.estate_settings)
EXEC('INSERT INTO dbo.Tmp_estate_settings (EstateID, EstateName, AbuseEmailToEstateOwner, DenyAnonymous, ResetHomeOnTeleport, FixedSun, DenyTransacted, BlockDwell, DenyIdentified, AllowVoice, UseGlobalTime, PricePerMeter, TaxFree, AllowDirectTeleport, RedirectGridX, RedirectGridY, ParentEstateID, SunPosition, EstateSkipScripts, BillableFactor, PublicAccess, AbuseEmail, EstateOwner, DenyMinors)
SELECT EstateID, EstateName, AbuseEmailToEstateOwner, DenyAnonymous, ResetHomeOnTeleport, FixedSun, DenyTransacted, BlockDwell, DenyIdentified, AllowVoice, UseGlobalTime, PricePerMeter, TaxFree, AllowDirectTeleport, RedirectGridX, RedirectGridY, ParentEstateID, SunPosition, EstateSkipScripts, BillableFactor, PublicAccess, AbuseEmail, CONVERT(uniqueidentifier, EstateOwner), DenyMinors FROM dbo.estate_settings WITH (HOLDLOCK TABLOCKX)')
SET IDENTITY_INSERT dbo.Tmp_estate_settings OFF
DROP TABLE dbo.estate_settings
EXECUTE sp_rename N'dbo.Tmp_estate_settings', N'estate_settings', 'OBJECT'
ALTER TABLE dbo.estate_settings ADD CONSTRAINT
PK_estate_settings PRIMARY KEY CLUSTERED
(
EstateID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
:VERSION 9
BEGIN TRANSACTION
CREATE TABLE dbo.Tmp_estate_map
(
RegionID uniqueidentifier NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
EstateID int NOT NULL
) ON [PRIMARY]
IF EXISTS(SELECT * FROM dbo.estate_map)
EXEC('INSERT INTO dbo.Tmp_estate_map (RegionID, EstateID)
SELECT CONVERT(uniqueidentifier, RegionID), EstateID FROM dbo.estate_map WITH (HOLDLOCK TABLOCKX)')
DROP TABLE dbo.estate_map
EXECUTE sp_rename N'dbo.Tmp_estate_map', N'estate_map', 'OBJECT'
ALTER TABLE dbo.estate_map ADD CONSTRAINT
PK_estate_map PRIMARY KEY CLUSTERED
(
RegionID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
COMMIT
|