aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGeir Nøklebye2017-05-08 00:40:15 +0100
committerUbitUmarov2017-05-09 12:00:45 +0100
commit03a38a80ab6a9ec4c55c79e4c671078231b69c6f (patch)
tree7492cda5e8be0acfc1fa35209449bd96f8bf8857
parentremove file bin/Mono.Posix.dll that causes problems with mono (diff)
downloadopensim-SC-03a38a80ab6a9ec4c55c79e4c671078231b69c6f.zip
opensim-SC-03a38a80ab6a9ec4c55c79e4c671078231b69c6f.tar.gz
opensim-SC-03a38a80ab6a9ec4c55c79e4c671078231b69c6f.tar.bz2
opensim-SC-03a38a80ab6a9ec4c55c79e4c671078231b69c6f.tar.xz
PGSQL: Rewrote EstateStore.migrations as it errored out in version 8 leaving the database without any estate tables on first run. It also lacked primary keys on estate_map and estate_settings. Syntax requires Postgresql 9.5 or higher.
Signed-off-by: UbitUmarov <ajlduarte@sapo.pt>
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/PGSQL/Resources/EstateStore.migrations403
1 files changed, 104 insertions, 299 deletions
diff --git a/OpenSim/Data/PGSQL/Resources/EstateStore.migrations b/OpenSim/Data/PGSQL/Resources/EstateStore.migrations
index 59270f8..63b70bd 100644
--- a/OpenSim/Data/PGSQL/Resources/EstateStore.migrations
+++ b/OpenSim/Data/PGSQL/Resources/EstateStore.migrations
@@ -1,307 +1,112 @@
1:VERSION 1 1:VERSION 12
2 2
3BEGIN TRANSACTION; 3BEGIN TRANSACTION;
4 4
5CREATE TABLE estate_managers( 5-- ----------------------------
6 "EstateID" int NOT NULL Primary Key, 6-- Table structure for estate_groups
7 uuid varchar(36) NOT NULL 7-- ----------------------------
8 ); 8CREATE TABLE IF NOT EXISTS "public"."estate_groups" (
9 9 "EstateID" int4 NOT NULL,
10CREATE TABLE estate_groups( 10 "uuid" uuid NOT NULL
11 "EstateID" int NOT NULL, 11)
12 uuid varchar(36) NOT NULL 12WITH (OIDS=FALSE);
13 ); 13
14 14-- Indexes structure for table estate_groups
15 15-- ----------------------------
16CREATE TABLE estate_users( 16CREATE INDEX IF NOT EXISTS "ix_estate_groups" ON "public"."estate_groups" USING btree("EstateID" "pg_catalog"."int4_ops" ASC NULLS LAST);
17 "EstateID" int NOT NULL, 17
18 uuid varchar(36) NOT NULL 18-- ----------------------------
19 ); 19-- Table structure for estate_managers
20 20-- ----------------------------
21 21CREATE TABLE IF NOT EXISTS "public"."estate_managers" (
22CREATE TABLE estateban( 22 "EstateID" int4 NOT NULL,
23 "EstateID" int NOT NULL, 23 "uuid" uuid NOT NULL
24 "bannedUUID" varchar(36) NOT NULL, 24)
25 "bannedIp" varchar(16) NOT NULL, 25WITH (OIDS=FALSE);
26 "bannedIpHostMask" varchar(16) NOT NULL, 26
27 "bannedNameMask" varchar(64) NULL DEFAULT NULL 27-- Indexes structure for table estate_managers
28 ); 28-- ----------------------------
29 29CREATE INDEX IF NOT EXISTS "ix_estate_managers" ON "public"."estate_managers" USING btree("EstateID" "pg_catalog"."int4_ops" ASC NULLS LAST);
30Create Sequence estate_settings_id increment by 100 start with 100; 30
31 31-- ----------------------------
32CREATE TABLE estate_settings( 32-- Table structure for estate_map
33 "EstateID" integer DEFAULT nextval('estate_settings_id') NOT NULL, 33-- ----------------------------
34 "EstateName" varchar(64) NULL DEFAULT (NULL), 34CREATE TABLE IF NOT EXISTS "public"."estate_map" (
35 "AbuseEmailToEstateOwner" boolean NOT NULL, 35 "RegionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'::uuid,
36 "DenyAnonymous" boolean NOT NULL, 36 "EstateID" int4 NOT NULL
37 "ResetHomeOnTeleport" boolean NOT NULL, 37)
38 "FixedSun" boolean NOT NULL, 38WITH (OIDS=FALSE);
39 "DenyTransacted" boolean NOT NULL, 39
40 "BlockDwell" boolean NOT NULL, 40-- Primary key structure for table estate_map
41 "DenyIdentified" boolean NOT NULL, 41-- ----------------------------
42 "AllowVoice" boolean NOT NULL, 42ALTER TABLE "public"."estate_map" ADD PRIMARY KEY ("RegionID") NOT DEFERRABLE INITIALLY IMMEDIATE;
43 "UseGlobalTime" boolean NOT NULL, 43
44 "PricePerMeter" int NOT NULL, 44-- ----------------------------
45 "TaxFree" boolean NOT NULL, 45-- Table structure for estate_settings
46 "AllowDirectTeleport" boolean NOT NULL, 46-- ----------------------------
47 "RedirectGridX" int NOT NULL, 47CREATE TABLE IF NOT EXISTS "public"."estate_settings" (
48 "RedirectGridY" int NOT NULL, 48 "EstateID" int4 NOT NULL DEFAULT nextval('estate_settings_id'::regclass),
49 "ParentEstateID" int NOT NULL, 49 "EstateName" varchar(64) DEFAULT NULL::character varying COLLATE "default",
50 "SunPosition" double precision NOT NULL, 50 "AbuseEmailToEstateOwner" bool NOT NULL,
51 "EstateSkipScripts" boolean NOT NULL, 51 "DenyAnonymous" bool NOT NULL,
52 "BillableFactor" double precision NOT NULL, 52 "ResetHomeOnTeleport" bool NOT NULL,
53 "PublicAccess" boolean NOT NULL, 53 "FixedSun" bool NOT NULL,
54 "AbuseEmail" varchar(255) NOT NULL, 54 "DenyTransacted" bool NOT NULL,
55 "EstateOwner" varchar(36) NOT NULL, 55 "BlockDwell" bool NOT NULL,
56 "DenyMinors" boolean NOT NULL 56 "DenyIdentified" bool NOT NULL,
57 ); 57 "AllowVoice" bool NOT NULL,
58 58 "UseGlobalTime" bool NOT NULL,
59 59 "PricePerMeter" int4 NOT NULL,
60CREATE TABLE estate_map( 60 "TaxFree" bool NOT NULL,
61 "RegionID" varchar(36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), 61 "AllowDirectTeleport" bool NOT NULL,
62 "EstateID" int NOT NULL 62 "RedirectGridX" int4 NOT NULL,
63 ); 63 "RedirectGridY" int4 NOT NULL,
64 64 "ParentEstateID" int4 NOT NULL,
65COMMIT; 65 "SunPosition" float8 NOT NULL,
66 66 "EstateSkipScripts" bool NOT NULL,
67:VERSION 2 67 "BillableFactor" float8 NOT NULL,
68 68 "PublicAccess" bool NOT NULL,
69BEGIN TRANSACTION; 69 "AbuseEmail" varchar(255) NOT NULL COLLATE "default",
70
71CREATE INDEX IX_estate_managers ON estate_managers
72 (
73 "EstateID"
74 );
75
76
77CREATE INDEX IX_estate_groups ON estate_groups
78 (
79 "EstateID"
80 );
81
82
83CREATE INDEX IX_estate_users ON estate_users
84 (
85 "EstateID"
86 );
87
88COMMIT;
89
90:VERSION 3
91
92BEGIN TRANSACTION;
93
94CREATE TABLE Tmp_estateban
95 (
96 "EstateID" int NOT NULL,
97 "bannedUUID" varchar(36) NOT NULL,
98 "bannedIp" varchar(16) NULL,
99 "bannedIpHostMask" varchar(16) NULL,
100 "bannedNameMask" varchar(64) NULL
101 );
102
103 INSERT INTO Tmp_estateban ("EstateID", "bannedUUID", "bannedIp", "bannedIpHostMask", "bannedNameMask")
104 SELECT "EstateID", "bannedUUID", "bannedIp", "bannedIpHostMask", "bannedNameMask" FROM estateban;
105
106DROP TABLE estateban;
107
108Alter table Tmp_estateban
109 rename to estateban;
110
111CREATE INDEX IX_estateban ON estateban
112 (
113 "EstateID"
114 );
115
116COMMIT;
117
118
119:VERSION 4
120
121BEGIN TRANSACTION;
122
123CREATE TABLE Tmp_estate_managers
124 (
125 "EstateID" int NOT NULL,
126 uuid uuid NOT NULL
127 );
128
129INSERT INTO Tmp_estate_managers ("EstateID", uuid)
130 SELECT "EstateID", cast(uuid as uuid) FROM estate_managers;
131
132DROP TABLE estate_managers;
133
134Alter table Tmp_estate_managers
135 rename to estate_managers;
136
137CREATE INDEX IX_estate_managers ON estate_managers
138 (
139 "EstateID"
140 );
141
142COMMIT;
143
144
145:VERSION 5
146
147BEGIN TRANSACTION;
148
149CREATE TABLE Tmp_estate_groups
150 (
151 "EstateID" int NOT NULL,
152 uuid uuid NOT NULL
153 ) ;
154
155 INSERT INTO Tmp_estate_groups ("EstateID", uuid)
156 SELECT "EstateID", cast(uuid as uuid) FROM estate_groups;
157
158DROP TABLE estate_groups;
159
160Alter table Tmp_estate_groups
161 rename to estate_groups;
162
163CREATE INDEX IX_estate_groups ON estate_groups
164 (
165 "EstateID"
166 );
167
168COMMIT;
169
170
171:VERSION 6
172
173BEGIN TRANSACTION;
174
175CREATE TABLE Tmp_estate_users
176 (
177 "EstateID" int NOT NULL,
178 uuid uuid NOT NULL
179 );
180
181INSERT INTO Tmp_estate_users ("EstateID", uuid)
182 SELECT "EstateID", cast(uuid as uuid) FROM estate_users ;
183
184DROP TABLE estate_users;
185
186Alter table Tmp_estate_users
187 rename to estate_users;
188
189CREATE INDEX IX_estate_users ON estate_users
190 (
191 "EstateID"
192 );
193
194COMMIT;
195
196
197:VERSION 7
198
199BEGIN TRANSACTION;
200
201CREATE TABLE Tmp_estateban
202 (
203 "EstateID" int NOT NULL,
204 "bannedUUID" uuid NOT NULL,
205 "bannedIp" varchar(16) NULL,
206 "bannedIpHostMask" varchar(16) NULL,
207 "bannedNameMask" varchar(64) NULL
208 );
209
210INSERT INTO Tmp_estateban ("EstateID", "bannedUUID", "bannedIp", "bannedIpHostMask", "bannedNameMask")
211 SELECT "EstateID", cast("bannedUUID" as uuid), "bannedIp", "bannedIpHostMask", "bannedNameMask" FROM estateban ;
212
213DROP TABLE estateban;
214
215Alter table Tmp_estateban
216 rename to estateban;
217
218CREATE INDEX IX_estateban ON estateban
219 (
220 "EstateID"
221 );
222
223COMMIT;
224
225
226:VERSION 8
227
228BEGIN TRANSACTION;
229
230CREATE TABLE Tmp_estate_settings
231 (
232 "EstateID" integer default nextval('estate_settings_id') NOT NULL,
233 "EstateName" varchar(64) NULL DEFAULT (NULL),
234 "AbuseEmailToEstateOwner" boolean NOT NULL,
235 "DenyAnonymous" boolean NOT NULL,
236 "ResetHomeOnTeleport" boolean NOT NULL,
237 "FixedSun" boolean NOT NULL,
238 "DenyTransacted" boolean NOT NULL,
239 "BlockDwell" boolean NOT NULL,
240 "DenyIdentified" boolean NOT NULL,
241 "AllowVoice" boolean NOT NULL,
242 "UseGlobalTime" boolean NOT NULL,
243 "PricePerMeter" int NOT NULL,
244 "TaxFree" boolean NOT NULL,
245 "AllowDirectTeleport" boolean NOT NULL,
246 "RedirectGridX" int NOT NULL,
247 "RedirectGridY" int NOT NULL,
248 "ParentEstateID" int NOT NULL,
249 "SunPosition" double precision NOT NULL,
250 "EstateSkipScripts" boolean NOT NULL,
251 "BillableFactor" double precision NOT NULL,
252 "PublicAccess" boolean NOT NULL,
253 "AbuseEmail" varchar(255) NOT NULL,
254 "EstateOwner" uuid NOT NULL, 70 "EstateOwner" uuid NOT NULL,
255 "DenyMinors" boolean NOT NULL 71 "DenyMinors" bool NOT NULL,
256 ); 72 "AllowLandmark" bool NOT NULL DEFAULT true,
257 73 "AllowParcelChanges" bool NOT NULL DEFAULT true,
258INSERT 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") 74 "AllowSetHome" bool NOT NULL DEFAULT true
259 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 ; 75)
260 76WITH (OIDS=FALSE);
261DROP TABLE estate_settings; 77
262 78-- Primary key structure for table estate_settings
263 79-- ----------------------------
264Alter table Tmp_estate_settings 80ALTER TABLE "public"."estate_settings" ADD PRIMARY KEY ("EstateID") NOT DEFERRABLE INITIALLY IMMEDIATE;
265 rename to estate_settings; 81
266 82-- ----------------------------
267 83-- Table structure for estate_users
268Create index on estate_settings (lower("EstateName")); 84-- ----------------------------
269 85CREATE TABLE IF NOT EXISTS "public"."estate_users" (
270COMMIT; 86 "EstateID" int4 NOT NULL,
271 87 "uuid" uuid NOT NULL
272 88)
273:VERSION 9 89WITH (OIDS=FALSE);
274 90
275BEGIN TRANSACTION; 91-- Indexes structure for table estate_users
276 92-- ----------------------------
277CREATE TABLE Tmp_estate_map 93CREATE INDEX IF NOT EXISTS "ix_estate_users" ON "public"."estate_users" USING btree("EstateID" "pg_catalog"."int4_ops" ASC NULLS LAST);
278 ( 94
279 "RegionID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), 95-- ----------------------------
280 "EstateID" int NOT NULL 96-- Table structure for estateban
281 ); 97-- ----------------------------
282 98CREATE TABLE IF NOT EXISTS "public"."estateban" (
283INSERT INTO Tmp_estate_map ("RegionID", "EstateID") 99 "EstateID" int4 NOT NULL,
284 SELECT cast("RegionID" as uuid), "EstateID" FROM estate_map ; 100 "bannedUUID" uuid NOT NULL,
285 101 "bannedIp" varchar(16) COLLATE "default",
286DROP TABLE estate_map; 102 "bannedIpHostMask" varchar(16) COLLATE "default",
287 103 "bannedNameMask" varchar(64) COLLATE "default"
288Alter table Tmp_estate_map 104)
289 rename to estate_map; 105WITH (OIDS=FALSE);
290
291COMMIT;
292 106
293:VERSION 10 107-- Indexes structure for table estateban
108-- ----------------------------
109CREATE INDEX IF NOT EXISTS "ix_estateban" ON "public"."estateban" USING btree("EstateID" "pg_catalog"."int4_ops" ASC NULLS LAST);
294 110
295BEGIN TRANSACTION;
296ALTER TABLE estate_settings ADD COLUMN "AllowLandmark" boolean NOT NULL default true;
297ALTER TABLE estate_settings ADD COLUMN "AllowParcelChanges" boolean NOT NULL default true;
298ALTER TABLE estate_settings ADD COLUMN "AllowSetHome" boolean NOT NULL default true;
299COMMIT; 111COMMIT;
300 112
301:VERSION 11
302
303Begin transaction;
304
305
306Commit;
307