diff options
author | Fernando Oliveira | 2013-10-12 16:33:45 -0500 |
---|---|---|
committer | fernando | 2013-10-12 16:33:45 -0500 |
commit | ff8a76825841533bdc5d534b6f58b2ab964ea6c6 (patch) | |
tree | 4ddde40916db04c1506486c9e7ba88b37f53e23e /OpenSim/Data/PGSQL/Resources/EstateStore.migrations | |
parent | * pushing test (diff) | |
download | opensim-SC-ff8a76825841533bdc5d534b6f58b2ab964ea6c6.zip opensim-SC-ff8a76825841533bdc5d534b6f58b2ab964ea6c6.tar.gz opensim-SC-ff8a76825841533bdc5d534b6f58b2ab964ea6c6.tar.bz2 opensim-SC-ff8a76825841533bdc5d534b6f58b2ab964ea6c6.tar.xz |
Fernando Oliveira's Postgress SQL Server Data Connector as a single commit.
* Added PostGreSQL support
* Added MySQL/MySQLXGroupData.cs
* PostgreSQL data access implementation
* PostgreSQL dll binarie and RegionStore.migrations
* Migrations Scripts from MSSQL to POSTGRES
* Postgres SQL Type fixes
* Postgres SQL Connection string
* Data type issues
* more fixes
* tests and +tests
* UUID x string - FIGHT!
* Fixed PG types to internal csharp types
* More data type fix (PostgreSQL fields are case sensitive) :(
* more field case sensitive fixes
* changed the migration files to be case sensitive for fields.
* fixed fields case
* finished converting, now search for hidden bugs.
* some more fixes
* bool type fixed
* more case fixes;
* creatorID case fixed
* case fields fixed
* fixed default now() for TMStamp fields with don't allow nulls.
* fix case sensitve for Region name and Estate name
* fixed case for names for search
* fix class name Error
* Bug fixed on select and migrations
* Un-Reverting my change due to Postgres issue with the ILIKE function
* Fixed some issued for Diva Distro
* Fixes for integration with Diva Distro
* Added System.Core to prebuild.xml for PG project
* Configured to make DIff for Push to OpenSim Project
* Diffs only to PostgreSQL mods.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/PGSQL/Resources/EstateStore.migrations | 307 |
1 files changed, 307 insertions, 0 deletions
diff --git a/OpenSim/Data/PGSQL/Resources/EstateStore.migrations b/OpenSim/Data/PGSQL/Resources/EstateStore.migrations new file mode 100644 index 0000000..59270f8 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/EstateStore.migrations | |||
@@ -0,0 +1,307 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | BEGIN TRANSACTION; | ||
4 | |||
5 | CREATE TABLE estate_managers( | ||
6 | "EstateID" int NOT NULL Primary Key, | ||
7 | uuid varchar(36) NOT NULL | ||
8 | ); | ||
9 | |||
10 | CREATE TABLE estate_groups( | ||
11 | "EstateID" int NOT NULL, | ||
12 | uuid varchar(36) NOT NULL | ||
13 | ); | ||
14 | |||
15 | |||
16 | CREATE TABLE estate_users( | ||
17 | "EstateID" int NOT NULL, | ||
18 | uuid varchar(36) NOT NULL | ||
19 | ); | ||
20 | |||
21 | |||
22 | CREATE TABLE estateban( | ||
23 | "EstateID" int NOT NULL, | ||
24 | "bannedUUID" varchar(36) NOT NULL, | ||
25 | "bannedIp" varchar(16) NOT NULL, | ||
26 | "bannedIpHostMask" varchar(16) NOT NULL, | ||
27 | "bannedNameMask" varchar(64) NULL DEFAULT NULL | ||
28 | ); | ||
29 | |||
30 | Create Sequence estate_settings_id increment by 100 start with 100; | ||
31 | |||
32 | CREATE TABLE estate_settings( | ||
33 | "EstateID" integer DEFAULT nextval('estate_settings_id') NOT NULL, | ||
34 | "EstateName" varchar(64) NULL DEFAULT (NULL), | ||
35 | "AbuseEmailToEstateOwner" boolean NOT NULL, | ||
36 | "DenyAnonymous" boolean NOT NULL, | ||
37 | "ResetHomeOnTeleport" boolean NOT NULL, | ||
38 | "FixedSun" boolean NOT NULL, | ||
39 | "DenyTransacted" boolean NOT NULL, | ||
40 | "BlockDwell" boolean NOT NULL, | ||
41 | "DenyIdentified" boolean NOT NULL, | ||
42 | "AllowVoice" boolean NOT NULL, | ||
43 | "UseGlobalTime" boolean NOT NULL, | ||
44 | "PricePerMeter" int NOT NULL, | ||
45 | "TaxFree" boolean NOT NULL, | ||
46 | "AllowDirectTeleport" boolean NOT NULL, | ||
47 | "RedirectGridX" int NOT NULL, | ||
48 | "RedirectGridY" int NOT NULL, | ||
49 | "ParentEstateID" int NOT NULL, | ||
50 | "SunPosition" double precision NOT NULL, | ||
51 | "EstateSkipScripts" boolean NOT NULL, | ||
52 | "BillableFactor" double precision NOT NULL, | ||
53 | "PublicAccess" boolean NOT NULL, | ||
54 | "AbuseEmail" varchar(255) NOT NULL, | ||
55 | "EstateOwner" varchar(36) NOT NULL, | ||
56 | "DenyMinors" boolean NOT NULL | ||
57 | ); | ||
58 | |||
59 | |||
60 | CREATE TABLE estate_map( | ||
61 | "RegionID" varchar(36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), | ||
62 | "EstateID" int NOT NULL | ||
63 | ); | ||
64 | |||
65 | COMMIT; | ||
66 | |||
67 | :VERSION 2 | ||
68 | |||
69 | BEGIN TRANSACTION; | ||
70 | |||
71 | CREATE INDEX IX_estate_managers ON estate_managers | ||
72 | ( | ||
73 | "EstateID" | ||
74 | ); | ||
75 | |||
76 | |||
77 | CREATE INDEX IX_estate_groups ON estate_groups | ||
78 | ( | ||
79 | "EstateID" | ||
80 | ); | ||
81 | |||
82 | |||
83 | CREATE INDEX IX_estate_users ON estate_users | ||
84 | ( | ||
85 | "EstateID" | ||
86 | ); | ||
87 | |||
88 | COMMIT; | ||
89 | |||
90 | :VERSION 3 | ||
91 | |||
92 | BEGIN TRANSACTION; | ||
93 | |||
94 | CREATE 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 | |||
106 | DROP TABLE estateban; | ||
107 | |||
108 | Alter table Tmp_estateban | ||
109 | rename to estateban; | ||
110 | |||
111 | CREATE INDEX IX_estateban ON estateban | ||
112 | ( | ||
113 | "EstateID" | ||
114 | ); | ||
115 | |||
116 | COMMIT; | ||
117 | |||
118 | |||
119 | :VERSION 4 | ||
120 | |||
121 | BEGIN TRANSACTION; | ||
122 | |||
123 | CREATE TABLE Tmp_estate_managers | ||
124 | ( | ||
125 | "EstateID" int NOT NULL, | ||
126 | uuid uuid NOT NULL | ||
127 | ); | ||
128 | |||
129 | INSERT INTO Tmp_estate_managers ("EstateID", uuid) | ||
130 | SELECT "EstateID", cast(uuid as uuid) FROM estate_managers; | ||
131 | |||
132 | DROP TABLE estate_managers; | ||
133 | |||
134 | Alter table Tmp_estate_managers | ||
135 | rename to estate_managers; | ||
136 | |||
137 | CREATE INDEX IX_estate_managers ON estate_managers | ||
138 | ( | ||
139 | "EstateID" | ||
140 | ); | ||
141 | |||
142 | COMMIT; | ||
143 | |||
144 | |||
145 | :VERSION 5 | ||
146 | |||
147 | BEGIN TRANSACTION; | ||
148 | |||
149 | CREATE 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 | |||
158 | DROP TABLE estate_groups; | ||
159 | |||
160 | Alter table Tmp_estate_groups | ||
161 | rename to estate_groups; | ||
162 | |||
163 | CREATE INDEX IX_estate_groups ON estate_groups | ||
164 | ( | ||
165 | "EstateID" | ||
166 | ); | ||
167 | |||
168 | COMMIT; | ||
169 | |||
170 | |||
171 | :VERSION 6 | ||
172 | |||
173 | BEGIN TRANSACTION; | ||
174 | |||
175 | CREATE TABLE Tmp_estate_users | ||
176 | ( | ||
177 | "EstateID" int NOT NULL, | ||
178 | uuid uuid NOT NULL | ||
179 | ); | ||
180 | |||
181 | INSERT INTO Tmp_estate_users ("EstateID", uuid) | ||
182 | SELECT "EstateID", cast(uuid as uuid) FROM estate_users ; | ||
183 | |||
184 | DROP TABLE estate_users; | ||
185 | |||
186 | Alter table Tmp_estate_users | ||
187 | rename to estate_users; | ||
188 | |||
189 | CREATE INDEX IX_estate_users ON estate_users | ||
190 | ( | ||
191 | "EstateID" | ||
192 | ); | ||
193 | |||
194 | COMMIT; | ||
195 | |||
196 | |||
197 | :VERSION 7 | ||
198 | |||
199 | BEGIN TRANSACTION; | ||
200 | |||
201 | CREATE 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 | |||
210 | INSERT INTO Tmp_estateban ("EstateID", "bannedUUID", "bannedIp", "bannedIpHostMask", "bannedNameMask") | ||
211 | SELECT "EstateID", cast("bannedUUID" as uuid), "bannedIp", "bannedIpHostMask", "bannedNameMask" FROM estateban ; | ||
212 | |||
213 | DROP TABLE estateban; | ||
214 | |||
215 | Alter table Tmp_estateban | ||
216 | rename to estateban; | ||
217 | |||
218 | CREATE INDEX IX_estateban ON estateban | ||
219 | ( | ||
220 | "EstateID" | ||
221 | ); | ||
222 | |||
223 | COMMIT; | ||
224 | |||
225 | |||
226 | :VERSION 8 | ||
227 | |||
228 | BEGIN TRANSACTION; | ||
229 | |||
230 | CREATE 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, | ||
255 | "DenyMinors" boolean NOT NULL | ||
256 | ); | ||
257 | |||
258 | 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") | ||
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 ; | ||
260 | |||
261 | DROP TABLE estate_settings; | ||
262 | |||
263 | |||
264 | Alter table Tmp_estate_settings | ||
265 | rename to estate_settings; | ||
266 | |||
267 | |||
268 | Create index on estate_settings (lower("EstateName")); | ||
269 | |||
270 | COMMIT; | ||
271 | |||
272 | |||
273 | :VERSION 9 | ||
274 | |||
275 | BEGIN TRANSACTION; | ||
276 | |||
277 | CREATE TABLE Tmp_estate_map | ||
278 | ( | ||
279 | "RegionID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), | ||
280 | "EstateID" int NOT NULL | ||
281 | ); | ||
282 | |||
283 | INSERT INTO Tmp_estate_map ("RegionID", "EstateID") | ||
284 | SELECT cast("RegionID" as uuid), "EstateID" FROM estate_map ; | ||
285 | |||
286 | DROP TABLE estate_map; | ||
287 | |||
288 | Alter table Tmp_estate_map | ||
289 | rename to estate_map; | ||
290 | |||
291 | COMMIT; | ||
292 | |||
293 | :VERSION 10 | ||
294 | |||
295 | BEGIN TRANSACTION; | ||
296 | ALTER TABLE estate_settings ADD COLUMN "AllowLandmark" boolean NOT NULL default true; | ||
297 | ALTER TABLE estate_settings ADD COLUMN "AllowParcelChanges" boolean NOT NULL default true; | ||
298 | ALTER TABLE estate_settings ADD COLUMN "AllowSetHome" boolean NOT NULL default true; | ||
299 | COMMIT; | ||
300 | |||
301 | :VERSION 11 | ||
302 | |||
303 | Begin transaction; | ||
304 | |||
305 | |||
306 | Commit; | ||
307 | |||