aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/PGSQL/Resources/EstateStore.migrations
blob: 59270f8b01b18ed8ddd5ac9b1f0b7e1a660a9db5 (plain)
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
:VERSION 1

BEGIN TRANSACTION;

CREATE TABLE estate_managers(
	"EstateID" int NOT NULL Primary Key,
	uuid varchar(36) NOT NULL
 );
 
CREATE TABLE estate_groups(
	"EstateID" int NOT NULL,
	uuid varchar(36) NOT NULL
	);


CREATE TABLE estate_users(
	"EstateID" int NOT NULL,
	uuid varchar(36) NOT NULL
	);


CREATE TABLE 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
	);

Create Sequence estate_settings_id increment by 100 start with 100;

CREATE TABLE estate_settings(
	"EstateID" integer DEFAULT nextval('estate_settings_id') NOT NULL,
	"EstateName" varchar(64) NULL DEFAULT (NULL),
	"AbuseEmailToEstateOwner" boolean NOT NULL,
	"DenyAnonymous" boolean NOT NULL,
	"ResetHomeOnTeleport" boolean NOT NULL,
	"FixedSun" boolean NOT NULL,
	"DenyTransacted" boolean NOT NULL,
	"BlockDwell" boolean NOT NULL,
	"DenyIdentified" boolean NOT NULL,
	"AllowVoice" boolean NOT NULL,
	"UseGlobalTime" boolean NOT NULL,
	"PricePerMeter" int NOT NULL,
	"TaxFree" boolean NOT NULL,
	"AllowDirectTeleport" boolean NOT NULL,
	"RedirectGridX" int NOT NULL,
	"RedirectGridY" int NOT NULL,
	"ParentEstateID" int NOT NULL,
	"SunPosition" double precision NOT NULL,
	"EstateSkipScripts" boolean NOT NULL,
	"BillableFactor" double precision NOT NULL,
	"PublicAccess" boolean NOT NULL,
	"AbuseEmail" varchar(255) NOT NULL,
	"EstateOwner" varchar(36) NOT NULL,
	"DenyMinors" boolean NOT NULL
	);


CREATE TABLE estate_map(
	"RegionID" varchar(36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
	"EstateID" int NOT NULL
 );
 
COMMIT;

:VERSION 2

BEGIN TRANSACTION;

CREATE INDEX IX_estate_managers ON estate_managers
	(
	"EstateID"
	);


CREATE INDEX IX_estate_groups ON estate_groups
	(
	"EstateID"
	);


CREATE INDEX IX_estate_users ON estate_users
	(
	"EstateID"
	);

COMMIT;

:VERSION 3

BEGIN TRANSACTION;

CREATE TABLE Tmp_estateban
	(
	"EstateID" int NOT NULL,
	"bannedUUID" varchar(36) NOT NULL,
	"bannedIp" varchar(16) NULL,
	"bannedIpHostMask" varchar(16) NULL,
	"bannedNameMask" varchar(64) NULL
	);

 INSERT INTO Tmp_estateban ("EstateID", "bannedUUID", "bannedIp", "bannedIpHostMask", "bannedNameMask")
   SELECT "EstateID", "bannedUUID", "bannedIp", "bannedIpHostMask", "bannedNameMask" FROM estateban;

DROP TABLE estateban;

Alter table Tmp_estateban
  rename to estateban;

CREATE INDEX IX_estateban ON estateban
	(
	"EstateID"
	);

COMMIT;


:VERSION 4

BEGIN TRANSACTION;

CREATE TABLE Tmp_estate_managers
	(
	"EstateID" int NOT NULL,
	uuid uuid NOT NULL
	);

INSERT INTO Tmp_estate_managers ("EstateID", uuid)
	SELECT "EstateID", cast(uuid as uuid) FROM estate_managers;

DROP TABLE estate_managers;

Alter table Tmp_estate_managers
  rename to estate_managers;

CREATE INDEX IX_estate_managers ON estate_managers
	(
	"EstateID"
	);

COMMIT;


:VERSION 5

BEGIN TRANSACTION;

CREATE TABLE Tmp_estate_groups
	(
	"EstateID" int NOT NULL,
	uuid uuid NOT NULL
	) ;

 INSERT INTO Tmp_estate_groups ("EstateID", uuid)
	SELECT "EstateID", cast(uuid as uuid) FROM estate_groups;

DROP TABLE estate_groups;

Alter table Tmp_estate_groups
  rename to estate_groups;

CREATE INDEX IX_estate_groups ON estate_groups
	(
	"EstateID"
	);

COMMIT;


:VERSION 6

BEGIN TRANSACTION;

CREATE TABLE Tmp_estate_users
	(
	"EstateID" int NOT NULL,
	uuid uuid NOT NULL
	);

INSERT INTO Tmp_estate_users ("EstateID", uuid)
	SELECT "EstateID", cast(uuid as uuid) FROM estate_users ;

DROP TABLE estate_users;

Alter table Tmp_estate_users
  rename to estate_users;

CREATE INDEX IX_estate_users ON estate_users
	(
	"EstateID"
	);

COMMIT;


:VERSION 7

BEGIN TRANSACTION;

CREATE TABLE Tmp_estateban
	(
	"EstateID" int NOT NULL,
	"bannedUUID" uuid NOT NULL,
	"bannedIp" varchar(16) NULL,
	"bannedIpHostMask" varchar(16) NULL,
	"bannedNameMask" varchar(64) NULL
	);

INSERT INTO Tmp_estateban ("EstateID", "bannedUUID", "bannedIp", "bannedIpHostMask", "bannedNameMask")
	SELECT "EstateID", cast("bannedUUID" as uuid), "bannedIp", "bannedIpHostMask", "bannedNameMask" FROM estateban ;

DROP TABLE estateban;

Alter table Tmp_estateban
  rename to estateban;

CREATE INDEX IX_estateban ON estateban
	(
	"EstateID"
	);

COMMIT;


:VERSION 8

BEGIN TRANSACTION;

CREATE TABLE Tmp_estate_settings
	(
	"EstateID" integer default nextval('estate_settings_id') NOT NULL,
	"EstateName" varchar(64) NULL DEFAULT (NULL),
	"AbuseEmailToEstateOwner" boolean NOT NULL,
	"DenyAnonymous" boolean NOT NULL,
	"ResetHomeOnTeleport" boolean NOT NULL,
	"FixedSun" boolean NOT NULL,
	"DenyTransacted" boolean NOT NULL,
	"BlockDwell" boolean NOT NULL,
	"DenyIdentified" boolean NOT NULL,
	"AllowVoice" boolean NOT NULL,
	"UseGlobalTime" boolean NOT NULL,
	"PricePerMeter" int NOT NULL,
	"TaxFree" boolean NOT NULL,
	"AllowDirectTeleport" boolean NOT NULL,
	"RedirectGridX" int NOT NULL,
	"RedirectGridY" int NOT NULL,
	"ParentEstateID" int NOT NULL,
	"SunPosition" double precision NOT NULL,
	"EstateSkipScripts" boolean NOT NULL,
	"BillableFactor" double precision NOT NULL,
	"PublicAccess" boolean NOT NULL,
	"AbuseEmail" varchar(255) NOT NULL,
	"EstateOwner" uuid NOT NULL,
	"DenyMinors" boolean NOT NULL
	);

INSERT INTO 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", cast("EstateOwner" as uuid), "DenyMinors" FROM estate_settings ;

DROP TABLE estate_settings;


Alter table Tmp_estate_settings
  rename to estate_settings;


Create index on estate_settings (lower("EstateName"));

COMMIT;


:VERSION 9

BEGIN TRANSACTION;

CREATE TABLE Tmp_estate_map
	(
	"RegionID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'),
	"EstateID" int NOT NULL
	);

INSERT INTO Tmp_estate_map ("RegionID", "EstateID")
	SELECT cast("RegionID" as uuid), "EstateID" FROM estate_map ;

DROP TABLE estate_map;

Alter table Tmp_estate_map
  rename to estate_map;

COMMIT;

:VERSION 10

BEGIN TRANSACTION;
ALTER TABLE estate_settings ADD COLUMN "AllowLandmark" boolean NOT NULL default true;
ALTER TABLE estate_settings ADD COLUMN "AllowParcelChanges" boolean NOT NULL default true;
ALTER TABLE estate_settings ADD COLUMN "AllowSetHome" boolean NOT NULL default true;
COMMIT;

:VERSION 11

Begin transaction;


Commit;