diff options
author | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-11-03 21:44:39 +1000 |
commit | 134f86e8d5c414409631b25b8c6f0ee45fbd8631 (patch) | |
tree | 216b89d3fb89acfb81be1e440c25c41ab09fa96d /OpenSim/Data/PGSQL/Resources | |
parent | More changing to production grid. Double oops. (diff) | |
download | opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.zip opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.gz opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.bz2 opensim-SC_OLD-134f86e8d5c414409631b25b8c6f0ee45fbd8631.tar.xz |
Initial update to OpenSim 0.8.2.1 source code.
Diffstat (limited to 'OpenSim/Data/PGSQL/Resources')
18 files changed, 3246 insertions, 0 deletions
diff --git a/OpenSim/Data/PGSQL/Resources/AssetStore.migrations b/OpenSim/Data/PGSQL/Resources/AssetStore.migrations new file mode 100644 index 0000000..7a858b4 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/AssetStore.migrations | |||
@@ -0,0 +1,99 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | CREATE TABLE assets ( | ||
4 | "id" varchar(36) NOT NULL PRIMARY KEY, | ||
5 | "name" varchar(64) NOT NULL, | ||
6 | "description" varchar(64) NOT NULL, | ||
7 | "assetType" smallint NOT NULL, | ||
8 | "local" smallint NOT NULL, | ||
9 | "temporary" smallint NOT NULL, | ||
10 | "data" bytea NOT NULL | ||
11 | ) ; | ||
12 | |||
13 | :VERSION 2 | ||
14 | |||
15 | BEGIN TRANSACTION; | ||
16 | |||
17 | CREATE TABLE Tmp_assets | ||
18 | ( | ||
19 | "id" varchar(36) NOT NULL, | ||
20 | "name" varchar(64) NOT NULL, | ||
21 | "description" varchar(64) NOT NULL, | ||
22 | "assetType" smallint NOT NULL, | ||
23 | "local" boolean NOT NULL, | ||
24 | "temporary" boolean NOT NULL, | ||
25 | "data" bytea NOT NULL | ||
26 | ) ; | ||
27 | |||
28 | INSERT INTO Tmp_assets ("id", "name", "description", "assetType", "local", "temporary", "data") | ||
29 | SELECT "id", "name", "description", "assetType", case when "local" = 1 then true else false end, case when "temporary" = 1 then true else false end, "data" | ||
30 | FROM assets ; | ||
31 | |||
32 | DROP TABLE assets; | ||
33 | |||
34 | Alter table Tmp_assets | ||
35 | rename to assets; | ||
36 | |||
37 | ALTER TABLE assets ADD PRIMARY KEY ("id"); | ||
38 | |||
39 | COMMIT; | ||
40 | |||
41 | |||
42 | :VERSION 3 | ||
43 | |||
44 | BEGIN TRANSACTION; | ||
45 | |||
46 | ALTER TABLE assets add "create_time" integer default 0; | ||
47 | ALTER TABLE assets add "access_time" integer default 0; | ||
48 | |||
49 | COMMIT; | ||
50 | |||
51 | |||
52 | :VERSION 4 | ||
53 | |||
54 | BEGIN TRANSACTION; | ||
55 | |||
56 | CREATE TABLE Tmp_assets | ||
57 | ( | ||
58 | "id" uuid NOT NULL, | ||
59 | "name" varchar(64) NOT NULL, | ||
60 | "description" varchar(64) NOT NULL, | ||
61 | "assetType" smallint NOT NULL, | ||
62 | "local" boolean NOT NULL, | ||
63 | "temporary" boolean NOT NULL, | ||
64 | "data" bytea NOT NULL, | ||
65 | "create_time" int NULL, | ||
66 | "access_time" int NULL | ||
67 | ) ; | ||
68 | |||
69 | |||
70 | INSERT INTO Tmp_assets ("id", "name", "description", "assetType", "local", "temporary", "data", "create_time", "access_time") | ||
71 | SELECT cast("id" as uuid), "name", "description", "assetType", "local", "temporary", "data", "create_time", "access_time" | ||
72 | FROM assets ; | ||
73 | |||
74 | DROP TABLE assets; | ||
75 | |||
76 | Alter table Tmp_assets | ||
77 | rename to assets; | ||
78 | |||
79 | ALTER TABLE assets ADD PRIMARY KEY ("id"); | ||
80 | |||
81 | COMMIT; | ||
82 | |||
83 | |||
84 | :VERSION 5 | ||
85 | |||
86 | DELETE FROM assets WHERE "id" = 'dc4b9f0b-d008-45c6-96a4-01dd947ac621'; | ||
87 | |||
88 | :VERSION 6 | ||
89 | |||
90 | ALTER TABLE assets ADD "asset_flags" INTEGER NOT NULL DEFAULT 0; | ||
91 | |||
92 | :VERSION 7 | ||
93 | |||
94 | alter table assets add "creatorid" varchar(36) not null default ''; | ||
95 | |||
96 | :VERSION 8 | ||
97 | |||
98 | BEGIN TRANSACTION; | ||
99 | COMMIT; | ||
diff --git a/OpenSim/Data/PGSQL/Resources/AuthStore.migrations b/OpenSim/Data/PGSQL/Resources/AuthStore.migrations new file mode 100644 index 0000000..a1f5b61 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/AuthStore.migrations | |||
@@ -0,0 +1,32 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | BEGIN TRANSACTION; | ||
4 | |||
5 | CREATE TABLE auth ( | ||
6 | uuid uuid NOT NULL default '00000000-0000-0000-0000-000000000000', | ||
7 | "passwordHash" varchar(32) NOT NULL, | ||
8 | "passwordSalt" varchar(32) NOT NULL, | ||
9 | "webLoginKey" varchar(255) NOT NULL, | ||
10 | "accountType" VARCHAR(32) NOT NULL DEFAULT 'UserAccount' | ||
11 | ) ; | ||
12 | |||
13 | CREATE TABLE tokens ( | ||
14 | uuid uuid NOT NULL default '00000000-0000-0000-0000-000000000000', | ||
15 | token varchar(255) NOT NULL, | ||
16 | validity TIMESTAMP NOT NULL ) | ||
17 | ; | ||
18 | |||
19 | COMMIT; | ||
20 | |||
21 | :VERSION 2 | ||
22 | |||
23 | BEGIN TRANSACTION; | ||
24 | |||
25 | INSERT INTO auth (uuid, "passwordHash", "passwordSalt", "webLoginKey", "accountType") | ||
26 | SELECT uuid AS UUID, passwordHash AS passwordHash, passwordSalt AS passwordSalt, webLoginKey AS webLoginKey, 'UserAccount' as accountType | ||
27 | FROM users | ||
28 | where exists ( Select * from information_schema.tables where table_name = 'users' ) | ||
29 | ; | ||
30 | |||
31 | COMMIT; | ||
32 | |||
diff --git a/OpenSim/Data/PGSQL/Resources/Avatar.migrations b/OpenSim/Data/PGSQL/Resources/Avatar.migrations new file mode 100644 index 0000000..160086d --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/Avatar.migrations | |||
@@ -0,0 +1,59 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | BEGIN TRANSACTION; | ||
4 | |||
5 | CREATE TABLE Avatars ( | ||
6 | "PrincipalID" uuid NOT NULL PRIMARY KEY, | ||
7 | "Name" varchar(32) NOT NULL, | ||
8 | "Value" varchar(255) NOT NULL DEFAULT '' | ||
9 | ); | ||
10 | |||
11 | |||
12 | COMMIT; | ||
13 | |||
14 | :VERSION 2 | ||
15 | |||
16 | BEGIN TRANSACTION; | ||
17 | |||
18 | CREATE TABLE Tmp_Avatars | ||
19 | ( | ||
20 | "PrincipalID" uuid NOT NULL, | ||
21 | "Name" varchar(32) NOT NULL, | ||
22 | "Value" text NOT NULL DEFAULT '' | ||
23 | ) ; | ||
24 | |||
25 | INSERT INTO Tmp_Avatars ("PrincipalID", "Name", "Value") | ||
26 | SELECT "PrincipalID", cast("Name" as text), "Value" | ||
27 | FROM Avatars ; | ||
28 | |||
29 | DROP TABLE Avatars; | ||
30 | |||
31 | Alter table Tmp_Avatars | ||
32 | rename to Avatars; | ||
33 | |||
34 | COMMIT; | ||
35 | |||
36 | :VERSION 3 | ||
37 | |||
38 | BEGIN TRANSACTION; | ||
39 | |||
40 | CREATE TABLE Tmp_Avatars | ||
41 | ( | ||
42 | "PrincipalID" uuid NOT NULL, | ||
43 | "Name" varchar(32) NOT NULL, | ||
44 | "Value" text NOT NULL DEFAULT '' | ||
45 | ); | ||
46 | |||
47 | ALTER TABLE Tmp_Avatars ADD PRIMARY KEY ("PrincipalID", "Name"); | ||
48 | |||
49 | |||
50 | INSERT INTO Tmp_Avatars ("PrincipalID", "Name", "Value") | ||
51 | SELECT "PrincipalID", "Name", cast("Value" as text) FROM Avatars ; | ||
52 | |||
53 | DROP TABLE Avatars; | ||
54 | |||
55 | Alter table Tmp_Avatars | ||
56 | rename to Avatars; | ||
57 | |||
58 | COMMIT; | ||
59 | |||
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 | |||
diff --git a/OpenSim/Data/PGSQL/Resources/FriendsStore.migrations b/OpenSim/Data/PGSQL/Resources/FriendsStore.migrations new file mode 100644 index 0000000..a87199b --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/FriendsStore.migrations | |||
@@ -0,0 +1,44 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | BEGIN TRANSACTION; | ||
4 | |||
5 | CREATE TABLE Friends ( | ||
6 | "PrincipalID" uuid NOT NULL, | ||
7 | "Friend" varchar(255) NOT NULL, | ||
8 | "Flags" char(16) NOT NULL DEFAULT '0', | ||
9 | "Offered" varchar(32) NOT NULL DEFAULT 0); | ||
10 | |||
11 | |||
12 | COMMIT; | ||
13 | |||
14 | :VERSION 2 | ||
15 | |||
16 | BEGIN TRANSACTION; | ||
17 | |||
18 | INSERT INTO Friends ("PrincipalID", "Friend", "Flags", "Offered") | ||
19 | SELECT "ownerID", "friendID", "friendPerms", 0 FROM userfriends; | ||
20 | |||
21 | COMMIT; | ||
22 | |||
23 | :VERSION 3 | ||
24 | |||
25 | BEGIN TRANSACTION; | ||
26 | |||
27 | CREATE TABLE Tmp_Friends | ||
28 | ("PrincipalID" varchar(255) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', | ||
29 | "Friend" varchar(255) NOT NULL, | ||
30 | "Flags" char(16) NOT NULL DEFAULT '0', | ||
31 | "Offered" varchar(32) NOT NULL DEFAULT 0) ; | ||
32 | |||
33 | INSERT INTO Tmp_Friends ("PrincipalID", "Friend", "Flags", "Offered") | ||
34 | SELECT cast("PrincipalID" as varchar(255)), "Friend", "Flags", "Offered" FROM Friends ; | ||
35 | |||
36 | DROP TABLE Friends; | ||
37 | |||
38 | Alter table Tmp_Friends | ||
39 | rename to Friends; | ||
40 | |||
41 | ALTER TABLE Friends ADD PRIMARY KEY("PrincipalID", "Friend"); | ||
42 | |||
43 | |||
44 | COMMIT; | ||
diff --git a/OpenSim/Data/PGSQL/Resources/GridStore.migrations b/OpenSim/Data/PGSQL/Resources/GridStore.migrations new file mode 100644 index 0000000..0ab8d2b --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/GridStore.migrations | |||
@@ -0,0 +1,242 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | BEGIN TRANSACTION; | ||
4 | |||
5 | CREATE TABLE regions( | ||
6 | "regionHandle" varchar(255) NULL, | ||
7 | "regionName" varchar(255) NULL, | ||
8 | uuid varchar(255) NOT NULL PRIMARY KEY, | ||
9 | "regionRecvKey" varchar(255) NULL, | ||
10 | "regionSecret" varchar(255) NULL, | ||
11 | "regionSendKey" varchar(255) NULL, | ||
12 | "regionDataURI" varchar(255) NULL, | ||
13 | "serverIP" varchar(255) NULL, | ||
14 | "serverPort" varchar(255) NULL, | ||
15 | "serverURI" varchar(255) NULL, | ||
16 | "locX" varchar(255) NULL, | ||
17 | "locY" varchar(255) NULL, | ||
18 | "locZ" varchar(255) NULL, | ||
19 | "eastOverrideHandle" varchar(255) NULL, | ||
20 | "westOverrideHandle" varchar(255) NULL, | ||
21 | "southOverrideHandle" varchar(255) NULL, | ||
22 | "northOverrideHandle" varchar(255) NULL, | ||
23 | "regionAssetURI" varchar(255) NULL, | ||
24 | "regionAssetRecvKey" varchar(255) NULL, | ||
25 | "regionAssetSendKey" varchar(255) NULL, | ||
26 | "regionUserURI" varchar(255) NULL, | ||
27 | "regionUserRecvKey" varchar(255) NULL, | ||
28 | "regionUserSendKey" varchar(255) NULL, | ||
29 | "regionMapTexture" varchar(255) NULL, | ||
30 | "serverHttpPort" varchar(255) NULL, | ||
31 | "serverRemotingPort" varchar(255) NULL, | ||
32 | "owner_uuid" varchar(36) NULL | ||
33 | ); | ||
34 | |||
35 | COMMIT; | ||
36 | |||
37 | |||
38 | :VERSION 2 | ||
39 | |||
40 | BEGIN TRANSACTION; | ||
41 | |||
42 | CREATE TABLE Tmp_regions | ||
43 | ( | ||
44 | uuid varchar(36) NOT NULL, | ||
45 | "regionHandle" bigint NULL, | ||
46 | "regionName" varchar(20) NULL, | ||
47 | "regionRecvKey" varchar(128) NULL, | ||
48 | "regionSendKey" varchar(128) NULL, | ||
49 | "regionSecret" varchar(128) NULL, | ||
50 | "regionDataURI" varchar(128) NULL, | ||
51 | "serverIP" varchar(64) NULL, | ||
52 | "serverPort" int NULL, | ||
53 | "serverURI" varchar(255) NULL, | ||
54 | "locX" int NULL, | ||
55 | "locY" int NULL, | ||
56 | "locZ" int NULL, | ||
57 | "eastOverrideHandle" bigint NULL, | ||
58 | "westOverrideHandle" bigint NULL, | ||
59 | "southOverrideHandle" bigint NULL, | ||
60 | "northOverrideHandle" bigint NULL, | ||
61 | "regionAssetURI" varchar(255) NULL, | ||
62 | "regionAssetRecvKey" varchar(128) NULL, | ||
63 | "regionAssetSendKey" varchar(128) NULL, | ||
64 | "regionUserURI" varchar(255) NULL, | ||
65 | "regionUserRecvKey" varchar(128) NULL, | ||
66 | "regionUserSendKey" varchar(128) NULL, | ||
67 | "regionMapTexture" varchar(36) NULL, | ||
68 | "serverHttpPort" int NULL, | ||
69 | "serverRemotingPort" int NULL, | ||
70 | "owner_uuid" varchar(36) NULL, | ||
71 | "originUUID" varchar(36) NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000') | ||
72 | ); | ||
73 | |||
74 | 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") | ||
75 | SELECT cast(uuid as varchar(36)), cast("regionHandle" as bigint), cast("regionName" as varchar(20)), cast("regionRecvKey" as varchar(128)), cast("regionSendKey" as varchar(128)), cast("regionSecret" as varchar(128)), cast("regionDataURI" as varchar(128)), cast("serverIP" as varchar(64)), cast("serverPort" as int), "serverURI", cast("locX" as int), cast("locY" as int), cast("locZ" as int), cast("eastOverrideHandle" as bigint), cast("westOverrideHandle" as bigint), | ||
76 | cast("southOverrideHandle" as bigint), cast("northOverrideHandle" as bigint), "regionAssetURI", cast("regionAssetRecvKey" as varchar(128)), cast("regionAssetSendKey" as varchar(128)), "regionUserURI", cast("regionUserRecvKey" as varchar(128)), cast("regionUserSendKey" as varchar(128)), cast("regionMapTexture" as varchar(36)), | ||
77 | cast("serverHttpPort" as int), cast("serverRemotingPort" as int), "owner_uuid" | ||
78 | FROM regions; | ||
79 | |||
80 | DROP TABLE regions; | ||
81 | |||
82 | alter table Tmp_regions | ||
83 | rename to regions; | ||
84 | |||
85 | COMMIT; | ||
86 | |||
87 | :VERSION 3 | ||
88 | |||
89 | BEGIN TRANSACTION; | ||
90 | |||
91 | CREATE INDEX IX_regions_name ON regions | ||
92 | ( | ||
93 | "regionName" | ||
94 | ); | ||
95 | |||
96 | CREATE INDEX IX_regions_handle ON regions | ||
97 | ( | ||
98 | "regionHandle" | ||
99 | ); | ||
100 | |||
101 | |||
102 | CREATE INDEX IX_regions_override ON regions | ||
103 | ( | ||
104 | "eastOverrideHandle", | ||
105 | "westOverrideHandle", | ||
106 | "southOverrideHandle", | ||
107 | "northOverrideHandle" | ||
108 | ); | ||
109 | |||
110 | COMMIT; | ||
111 | |||
112 | |||
113 | :VERSION 4 | ||
114 | |||
115 | /* To prevent any potential data loss issues, you should review this script in detail before running it outside the cotext of the database designer.*/ | ||
116 | BEGIN TRANSACTION; | ||
117 | |||
118 | CREATE TABLE Tmp_regions | ||
119 | ( | ||
120 | uuid uuid NOT NULL, | ||
121 | "regionHandle" bigint NULL, | ||
122 | "regionName" varchar(20) NULL, | ||
123 | "regionRecvKey" varchar(128) NULL, | ||
124 | "regionSendKey" varchar(128) NULL, | ||
125 | "regionSecret" varchar(128) NULL, | ||
126 | "regionDataURI" varchar(128) NULL, | ||
127 | "serverIP" varchar(64) NULL, | ||
128 | "serverPort" int NULL, | ||
129 | "serverURI" varchar(255) NULL, | ||
130 | "locX" int NULL, | ||
131 | "locY" int NULL, | ||
132 | "locZ" int NULL, | ||
133 | "eastOverrideHandle" bigint NULL, | ||
134 | "westOverrideHandle" bigint NULL, | ||
135 | "southOverrideHandle" bigint NULL, | ||
136 | "northOverrideHandle" bigint NULL, | ||
137 | "regionAssetURI" varchar(255) NULL, | ||
138 | "regionAssetRecvKey" varchar(128) NULL, | ||
139 | "regionAssetSendKey" varchar(128) NULL, | ||
140 | "regionUserURI" varchar(255) NULL, | ||
141 | "regionUserRecvKey" varchar(128) NULL, | ||
142 | "regionUserSendKey" varchar(128) NULL, | ||
143 | "regionMapTexture" uuid NULL, | ||
144 | "serverHttpPort" int NULL, | ||
145 | "serverRemotingPort" int NULL, | ||
146 | "owner_uuid" uuid NOT NULL, | ||
147 | "originUUID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000') | ||
148 | ); | ||
149 | |||
150 | |||
151 | 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", "originUUID") | ||
152 | SELECT cast(uuid as uuid), "regionHandle", "regionName", "regionRecvKey", "regionSendKey", "regionSecret", "regionDataURI", "serverIP", "serverPort", "serverURI", "locX", "locY", "locZ", "eastOverrideHandle", "westOverrideHandle", "southOverrideHandle", "northOverrideHandle", "regionAssetURI", "regionAssetRecvKey", "regionAssetSendKey", "regionUserURI", "regionUserRecvKey", "regionUserSendKey", cast("regionMapTexture" as uuid), "serverHttpPort", "serverRemotingPort", cast( "owner_uuid" as uuid), cast("originUUID" as uuid) FROM regions ; | ||
153 | |||
154 | |||
155 | DROP TABLE regions; | ||
156 | |||
157 | alter table Tmp_regions rename to regions; | ||
158 | |||
159 | ALTER TABLE regions ADD CONSTRAINT | ||
160 | PK__regions__uuid PRIMARY KEY | ||
161 | ( | ||
162 | uuid | ||
163 | ); | ||
164 | |||
165 | CREATE INDEX IX_regions_name ON regions | ||
166 | ( | ||
167 | "regionName" | ||
168 | ); | ||
169 | |||
170 | CREATE INDEX IX_regions_handle ON regions | ||
171 | ( | ||
172 | "regionHandle" | ||
173 | ); | ||
174 | |||
175 | CREATE INDEX IX_regions_override ON regions | ||
176 | ( | ||
177 | "eastOverrideHandle", | ||
178 | "westOverrideHandle", | ||
179 | "southOverrideHandle", | ||
180 | "northOverrideHandle" | ||
181 | ); | ||
182 | |||
183 | COMMIT; | ||
184 | |||
185 | |||
186 | :VERSION 5 | ||
187 | |||
188 | BEGIN TRANSACTION; | ||
189 | |||
190 | ALTER TABLE regions ADD access int default 0; | ||
191 | |||
192 | COMMIT; | ||
193 | |||
194 | |||
195 | :VERSION 6 | ||
196 | |||
197 | BEGIN TRANSACTION; | ||
198 | |||
199 | ALTER TABLE regions ADD "ScopeID" uuid default '00000000-0000-0000-0000-000000000000'; | ||
200 | ALTER TABLE regions alter column "owner_uuid" set DEFAULT ('00000000-0000-0000-0000-000000000000'); | ||
201 | ALTER TABLE regions ADD "sizeX" integer not null default 0; | ||
202 | ALTER TABLE regions ADD "sizeY" integer not null default 0; | ||
203 | |||
204 | COMMIT; | ||
205 | |||
206 | |||
207 | :VERSION 7 | ||
208 | |||
209 | BEGIN TRANSACTION; | ||
210 | |||
211 | ALTER TABLE regions ADD "flags" integer NOT NULL DEFAULT 0; | ||
212 | CREATE INDEX flags ON regions("flags"); | ||
213 | ALTER TABLE regions ADD "last_seen" integer NOT NULL DEFAULT 0; | ||
214 | ALTER TABLE regions ADD "PrincipalID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; | ||
215 | ALTER TABLE regions ADD "Token" varchar(255) NOT NULL DEFAULT 0; | ||
216 | |||
217 | COMMIT; | ||
218 | |||
219 | :VERSION 8 | ||
220 | |||
221 | BEGIN TRANSACTION; | ||
222 | ALTER TABLE regions ALTER COLUMN "regionName" type VarChar(128) ; | ||
223 | |||
224 | DROP INDEX IX_regions_name; | ||
225 | ALTER TABLE regions ALTER COLUMN "regionName" type VarChar(128), | ||
226 | ALTER COLUMN "regionName" SET NOT NULL; | ||
227 | |||
228 | CREATE INDEX IX_regions_name ON regions | ||
229 | ( | ||
230 | "regionName" | ||
231 | ); | ||
232 | |||
233 | COMMIT; | ||
234 | |||
235 | :VERSION 9 | ||
236 | |||
237 | BEGIN TRANSACTION; | ||
238 | |||
239 | ALTER TABLE regions ADD "parcelMapTexture" uuid NULL; | ||
240 | |||
241 | COMMIT; | ||
242 | |||
diff --git a/OpenSim/Data/PGSQL/Resources/GridUserStore.migrations b/OpenSim/Data/PGSQL/Resources/GridUserStore.migrations new file mode 100644 index 0000000..d37c4f6d --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/GridUserStore.migrations | |||
@@ -0,0 +1,60 @@ | |||
1 | :VERSION 1 # -------------------------- | ||
2 | |||
3 | BEGIN TRANSACTION; | ||
4 | |||
5 | CREATE TABLE GridUser ( | ||
6 | "UserID" VARCHAR(255) NOT NULL Primary Key, | ||
7 | "HomeRegionID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', | ||
8 | "HomePosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>', | ||
9 | "HomeLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>', | ||
10 | "LastRegionID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', | ||
11 | "LastPosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>', | ||
12 | "LastLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>', | ||
13 | "Online" CHAR(5) NOT NULL DEFAULT 'false', | ||
14 | "Login" CHAR(16) NOT NULL DEFAULT '0', | ||
15 | "Logout" CHAR(16) NOT NULL DEFAULT '0' | ||
16 | ) ; | ||
17 | |||
18 | COMMIT; | ||
19 | |||
20 | :VERSION 2 # -------------------------- | ||
21 | |||
22 | BEGIN TRANSACTION; | ||
23 | |||
24 | CREATE TABLE GridUser_tmp ( | ||
25 | "UserID" VARCHAR(255) NOT NULL PRIMARY KEY, | ||
26 | "HomeRegionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', | ||
27 | "HomePosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>', | ||
28 | "HomeLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>', | ||
29 | "LastRegionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', | ||
30 | "LastPosition" CHAR(64) NOT NULL DEFAULT '<0,0,0>', | ||
31 | "LastLookAt" CHAR(64) NOT NULL DEFAULT '<0,0,0>', | ||
32 | "Online" CHAR(5) NOT NULL DEFAULT 'false', | ||
33 | "Login" CHAR(16) NOT NULL DEFAULT '0', | ||
34 | "Logout" CHAR(16) NOT NULL DEFAULT '0' | ||
35 | ); | ||
36 | |||
37 | COMMIT; | ||
38 | |||
39 | |||
40 | INSERT INTO GridUser_tmp ("UserID" | ||
41 | ,"HomeRegionID" | ||
42 | ,"HomePosition" | ||
43 | ,"HomeLookAt" | ||
44 | ,"LastRegionID" | ||
45 | ,"LastPosition" | ||
46 | ,"LastLookAt" | ||
47 | ,"Online" | ||
48 | ,"Login" | ||
49 | ,"Logout") | ||
50 | SELECT "UserID", cast("HomeRegionID" as uuid), "HomePosition" ,"HomeLookAt" , cast("LastRegionID" as uuid), | ||
51 | "LastPosition" | ||
52 | ,"LastLookAt" | ||
53 | ,"Online" | ||
54 | ,"Login" | ||
55 | ,"Logout" FROM GridUser; | ||
56 | |||
57 | DROP TABLE GridUser; | ||
58 | |||
59 | alter table GridUser_tmp rename to GridUser; | ||
60 | |||
diff --git a/OpenSim/Data/PGSQL/Resources/HGTravelStore.migrations b/OpenSim/Data/PGSQL/Resources/HGTravelStore.migrations new file mode 100644 index 0000000..adf126d --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/HGTravelStore.migrations | |||
@@ -0,0 +1,17 @@ | |||
1 | :VERSION 1 # -------------------------- | ||
2 | |||
3 | BEGIN; | ||
4 | |||
5 | CREATE TABLE hg_traveling_data ( | ||
6 | "SessionID" VARCHAR(36) NOT NULL Primary Key, | ||
7 | "UserID" VARCHAR(36) NOT NULL, | ||
8 | "GridExternalName" VARCHAR(255) NOT NULL DEFAULT '', | ||
9 | "ServiceToken" VARCHAR(255) NOT NULL DEFAULT '', | ||
10 | "ClientIPAddress" VARCHAR(16) NOT NULL DEFAULT '', | ||
11 | "MyIPAddress" VARCHAR(16) NOT NULL DEFAULT '', | ||
12 | "TMStamp" timestamp NOT NULL default now() | ||
13 | ); | ||
14 | |||
15 | |||
16 | COMMIT; | ||
17 | |||
diff --git a/OpenSim/Data/PGSQL/Resources/IM_Store.migrations b/OpenSim/Data/PGSQL/Resources/IM_Store.migrations new file mode 100644 index 0000000..eb97824 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/IM_Store.migrations | |||
@@ -0,0 +1,45 @@ | |||
1 | :VERSION 1 # -------------------------- | ||
2 | |||
3 | BEGIN Transaction; | ||
4 | |||
5 | Create Sequence im_offiline_id increment by 1 start with 1; | ||
6 | |||
7 | CREATE TABLE im_offline ( | ||
8 | "ID" integer PRIMARY KEY NOT NULL DEFAULT nextval('im_offiline_id') , | ||
9 | "PrincipalID" char(36) NOT NULL default '', | ||
10 | "Message" text NOT NULL, | ||
11 | "TMStamp" timestamp NOT NULL default now() | ||
12 | ); | ||
13 | |||
14 | COMMIT; | ||
15 | |||
16 | :VERSION 2 # -------------------------- | ||
17 | |||
18 | BEGIN; | ||
19 | |||
20 | /* | ||
21 | INSERT INTO `im_offline` SELECT * from `diva_im_offline`; | ||
22 | DROP TABLE `diva_im_offline`; | ||
23 | DELETE FROM `migrations` WHERE name='diva_im_Store'; | ||
24 | */ | ||
25 | |||
26 | COMMIT; | ||
27 | |||
28 | :VERSION 3 # -------------------------- | ||
29 | |||
30 | BEGIN; | ||
31 | |||
32 | -- dropping the table here as there most likely is only one record in the table at the time of migration | ||
33 | |||
34 | DROP TABLE IF EXISTS "public"."im_offline"; | ||
35 | CREATE TABLE "public"."im_offline" ( | ||
36 | "ID" serial, | ||
37 | "PrincipalID" uuid NOT NULL, | ||
38 | "Message" text NOT NULL COLLATE "default", | ||
39 | "TMStamp" timestamp(6) NOT NULL DEFAULT clock_timestamp(), | ||
40 | "FromID" uuid NOT NULL | ||
41 | ) | ||
42 | WITH (OIDS=FALSE); | ||
43 | ALTER TABLE "public"."im_offline" ADD PRIMARY KEY ("ID","PrincipalID","FromID") NOT DEFERRABLE INITIALLY IMMEDIATE; | ||
44 | |||
45 | COMMIT; \ No newline at end of file | ||
diff --git a/OpenSim/Data/PGSQL/Resources/InventoryStore.migrations b/OpenSim/Data/PGSQL/Resources/InventoryStore.migrations new file mode 100644 index 0000000..8f7982a --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/InventoryStore.migrations | |||
@@ -0,0 +1,220 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | BEGIN TRANSACTION; | ||
4 | |||
5 | CREATE TABLE inventoryfolders ( | ||
6 | "folderID" varchar(36) NOT NULL default '' PRIMARY KEY, | ||
7 | "agentID" varchar(36) default NULL, | ||
8 | "parentFolderID" varchar(36) default NULL, | ||
9 | "folderName" varchar(64) default NULL, | ||
10 | "type" smallint NOT NULL default 0, | ||
11 | "version" int NOT NULL default 0 | ||
12 | ); | ||
13 | |||
14 | |||
15 | CREATE INDEX owner ON inventoryfolders | ||
16 | ( | ||
17 | "agentID" ASC | ||
18 | ); | ||
19 | |||
20 | CREATE INDEX parent ON inventoryfolders | ||
21 | ( | ||
22 | "parentFolderID" ASC | ||
23 | ); | ||
24 | |||
25 | |||
26 | CREATE TABLE inventoryitems ( | ||
27 | "inventoryID" varchar(36) NOT NULL default '' Primary Key, | ||
28 | "assetID" varchar(36) default NULL, | ||
29 | "assetType" int default NULL, | ||
30 | "parentFolderID" varchar(36) default NULL, | ||
31 | "avatarID" varchar(36) default NULL, | ||
32 | "inventoryName" varchar(64) default NULL, | ||
33 | "inventoryDescription" varchar(128) default NULL, | ||
34 | "inventoryNextPermissions" int default NULL, | ||
35 | "inventoryCurrentPermissions" int default NULL, | ||
36 | "invType" int default NULL, | ||
37 | "creatorID" varchar(36) default NULL, | ||
38 | "inventoryBasePermissions" int NOT NULL default 0, | ||
39 | "inventoryEveryOnePermissions" int NOT NULL default 0, | ||
40 | "salePrice" int default NULL, | ||
41 | "saleType" smallint default NULL, | ||
42 | "creationDate" int default NULL, | ||
43 | "groupID" varchar(36) default NULL, | ||
44 | "groupOwned" boolean default NULL, | ||
45 | "flags" int default NULL | ||
46 | ); | ||
47 | |||
48 | |||
49 | CREATE INDEX ii_owner ON inventoryitems | ||
50 | ( | ||
51 | "avatarID" ASC | ||
52 | ); | ||
53 | |||
54 | CREATE INDEX ii_folder ON inventoryitems | ||
55 | ( | ||
56 | "parentFolderID" ASC | ||
57 | ); | ||
58 | |||
59 | COMMIT; | ||
60 | |||
61 | |||
62 | :VERSION 2 | ||
63 | |||
64 | BEGIN TRANSACTION; | ||
65 | |||
66 | ALTER TABLE inventoryitems ADD "inventoryGroupPermissions" INTEGER NOT NULL default 0; | ||
67 | |||
68 | COMMIT; | ||
69 | |||
70 | :VERSION 3 | ||
71 | |||
72 | /* To prevent any potential data loss issues, you should review this script in detail before running it outside the cotext of the database designer.*/ | ||
73 | BEGIN TRANSACTION; | ||
74 | |||
75 | CREATE TABLE Tmp_inventoryfolders | ||
76 | ( | ||
77 | "folderID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), | ||
78 | "agentID" uuid NULL DEFAULT (NULL), | ||
79 | "parentFolderID" uuid NULL DEFAULT (NULL), | ||
80 | "folderName" varchar(64) NULL DEFAULT (NULL), | ||
81 | "type" smallint NOT NULL DEFAULT ((0)), | ||
82 | "version" int NOT NULL DEFAULT ((0)) | ||
83 | ); | ||
84 | |||
85 | INSERT INTO Tmp_inventoryfolders ("folderID", "agentID", "parentFolderID", "folderName", type, version) | ||
86 | SELECT cast("folderID" as uuid), cast("agentID" as uuid), cast("parentFolderID" as uuid), "folderName", "type", "version" | ||
87 | FROM inventoryfolders; | ||
88 | |||
89 | DROP TABLE inventoryfolders; | ||
90 | |||
91 | alter table Tmp_inventoryfolders rename to inventoryfolders; | ||
92 | |||
93 | ALTER TABLE inventoryfolders ADD CONSTRAINT | ||
94 | PK__inventor__C2FABFB3173876EA PRIMARY KEY | ||
95 | ( | ||
96 | "folderID" | ||
97 | ); | ||
98 | |||
99 | CREATE INDEX owner ON inventoryfolders | ||
100 | ( | ||
101 | "agentID" | ||
102 | ); | ||
103 | |||
104 | CREATE INDEX parent ON inventoryfolders | ||
105 | ( | ||
106 | "parentFolderID" | ||
107 | ); | ||
108 | |||
109 | COMMIT; | ||
110 | |||
111 | |||
112 | :VERSION 4 | ||
113 | |||
114 | BEGIN TRANSACTION; | ||
115 | |||
116 | CREATE TABLE Tmp_inventoryitems | ||
117 | ( | ||
118 | "inventoryID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), | ||
119 | "assetID" uuid NULL DEFAULT (NULL), | ||
120 | "assetType" int NULL DEFAULT (NULL), | ||
121 | "parentFolderID" uuid NULL DEFAULT (NULL), | ||
122 | "avatarID" uuid NULL DEFAULT (NULL), | ||
123 | "inventoryName" varchar(64) NULL DEFAULT (NULL), | ||
124 | "inventoryDescription" varchar(128) NULL DEFAULT (NULL), | ||
125 | "inventoryNextPermissions" int NULL DEFAULT (NULL), | ||
126 | "inventoryCurrentPermissions" int NULL DEFAULT (NULL), | ||
127 | "invType" int NULL DEFAULT (NULL), | ||
128 | "creatorID" uuid NULL DEFAULT (NULL), | ||
129 | "inventoryBasePermissions" int NOT NULL DEFAULT ((0)), | ||
130 | "inventoryEveryOnePermissions" int NOT NULL DEFAULT ((0)), | ||
131 | "salePrice" int NULL DEFAULT (NULL), | ||
132 | "SaleType" smallint NULL DEFAULT (NULL), | ||
133 | "creationDate" int NULL DEFAULT (NULL), | ||
134 | "groupID" uuid NULL DEFAULT (NULL), | ||
135 | "groupOwned" boolean NULL DEFAULT (NULL), | ||
136 | "flags" int NULL DEFAULT (NULL), | ||
137 | "inventoryGroupPermissions" int NOT NULL DEFAULT ((0)) | ||
138 | ); | ||
139 | |||
140 | |||
141 | INSERT INTO Tmp_inventoryitems ("inventoryID", "assetID", "assetType", "parentFolderID", "avatarID", "inventoryName", "inventoryDescription", "inventoryNextPermissions", "inventoryCurrentPermissions", "invType", "creatorID", "inventoryBasePermissions", "inventoryEveryOnePermissions", "salePrice", "SaleType", "creationDate", "groupID", "groupOwned", "flags", "inventoryGroupPermissions") | ||
142 | SELECT cast("inventoryID" as uuid), cast("assetID" as uuid), "assetType", cast("parentFolderID" as uuid), cast("avatarID" as uuid), "inventoryName", "inventoryDescription", "inventoryNextPermissions", "inventoryCurrentPermissions", "invType", cast("creatorID" as uuid), "inventoryBasePermissions", "inventoryEveryOnePermissions", "salePrice", "SaleType", "creationDate", cast("groupID" as uuid), "groupOwned", "flags", "inventoryGroupPermissions" | ||
143 | FROM inventoryitems ; | ||
144 | |||
145 | DROP TABLE inventoryitems; | ||
146 | |||
147 | alter table Tmp_inventoryitems rename to inventoryitems; | ||
148 | |||
149 | ALTER TABLE inventoryitems ADD CONSTRAINT | ||
150 | PK__inventor__C4B7BC2220C1E124 PRIMARY KEY | ||
151 | ( | ||
152 | "inventoryID" | ||
153 | ); | ||
154 | |||
155 | |||
156 | CREATE INDEX ii2_owner ON inventoryitems | ||
157 | ( | ||
158 | "avatarID" | ||
159 | ); | ||
160 | |||
161 | CREATE INDEX ii2_folder ON inventoryitems | ||
162 | ( | ||
163 | "parentFolderID" | ||
164 | ); | ||
165 | |||
166 | COMMIT; | ||
167 | |||
168 | :VERSION 5 | ||
169 | |||
170 | |||
171 | BEGIN TRANSACTION; | ||
172 | |||
173 | -- # Restoring defaults: | ||
174 | -- # NOTE: "inventoryID" does NOT need one: it's NOT NULL PK and a unique Guid must be provided every time anyway! | ||
175 | |||
176 | alter table inventoryitems | ||
177 | alter column "inventoryBasePermissions" set default 0; | ||
178 | alter table inventoryitems | ||
179 | alter column "inventoryEveryOnePermissions" set default 0; | ||
180 | alter table inventoryitems | ||
181 | alter column "inventoryGroupPermissions" set default 0 ; | ||
182 | |||
183 | COMMIT ; | ||
184 | |||
185 | :VERSION 7 | ||
186 | |||
187 | BEGIN TRANSACTION; | ||
188 | |||
189 | -- # "creatorID" goes back to VARCHAR(36) (???) | ||
190 | |||
191 | alter table inventoryitems | ||
192 | alter column "creatorID" type varchar(36); | ||
193 | |||
194 | COMMIT ; | ||
195 | |||
196 | :VERSION 8 | ||
197 | |||
198 | ALTER TABLE inventoryitems | ||
199 | alter column "creatorID" set DEFAULT '00000000-0000-0000-0000-000000000000'; | ||
200 | |||
201 | |||
202 | :VERSION 9 | ||
203 | |||
204 | BEGIN TRANSACTION; | ||
205 | |||
206 | --# "creatorID" goes up to VARCHAR(255) | ||
207 | |||
208 | alter table inventoryitems | ||
209 | alter column "creatorID" type varchar(255); | ||
210 | |||
211 | Commit; | ||
212 | |||
213 | :VERSION 10 | ||
214 | |||
215 | BEGIN TRANSACTION; | ||
216 | |||
217 | Alter table inventoryitems Rename Column "SaleType" to "saleType"; | ||
218 | |||
219 | Commit; | ||
220 | |||
diff --git a/OpenSim/Data/PGSQL/Resources/LogStore.migrations b/OpenSim/Data/PGSQL/Resources/LogStore.migrations new file mode 100644 index 0000000..83727c6 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/LogStore.migrations | |||
@@ -0,0 +1,16 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | BEGIN TRANSACTION; | ||
4 | |||
5 | CREATE TABLE logs ( | ||
6 | "logID" int NOT NULL Primary Key, | ||
7 | "target" varchar(36) default NULL, | ||
8 | "server" varchar(64) default NULL, | ||
9 | "method" varchar(64) default NULL, | ||
10 | "arguments" varchar(255) default NULL, | ||
11 | "priority" int default NULL, | ||
12 | "message" text | ||
13 | ); | ||
14 | |||
15 | COMMIT; | ||
16 | |||
diff --git a/OpenSim/Data/PGSQL/Resources/Presence.migrations b/OpenSim/Data/PGSQL/Resources/Presence.migrations new file mode 100755 index 0000000..5184034 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/Presence.migrations | |||
@@ -0,0 +1,42 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | BEGIN TRANSACTION; | ||
4 | |||
5 | CREATE TABLE Presence ( | ||
6 | "UserID" varchar(255) NOT NULL, | ||
7 | "RegionID" uuid NOT NULL, | ||
8 | "SessionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000', | ||
9 | "SecureSessionID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000' | ||
10 | ); | ||
11 | |||
12 | |||
13 | COMMIT; | ||
14 | |||
15 | :VERSION 2 | ||
16 | |||
17 | BEGIN TRANSACTION; | ||
18 | |||
19 | CREATE UNIQUE INDEX SessionID ON Presence("SessionID"); | ||
20 | CREATE INDEX UserID ON Presence("UserID"); | ||
21 | |||
22 | ALTER TABLE Presence ADD "LastSeen" Timestamp; | ||
23 | |||
24 | COMMIT; | ||
25 | |||
26 | :VERSION 3 # -------------------------- | ||
27 | |||
28 | BEGIN; | ||
29 | |||
30 | CREATE INDEX RegionID ON Presence("RegionID"); | ||
31 | |||
32 | COMMIT; | ||
33 | |||
34 | :VERSION 4 # Making sure LastSeen is actually defined in the table as it most likely erred in the double version 2 migration above | ||
35 | |||
36 | BEGIN; | ||
37 | |||
38 | ALTER TABLE Presence | ||
39 | DROP COLUMN IF EXISTS "LastSeen", | ||
40 | ADD COLUMN "LastSeen" Timestamp; | ||
41 | |||
42 | COMMIT; \ No newline at end of file | ||
diff --git a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations new file mode 100644 index 0000000..1284ce0 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations | |||
@@ -0,0 +1,1162 @@ | |||
1 | begin transaction ; | ||
2 | :VERSION 1 | ||
3 | |||
4 | CREATE TABLE prims( | ||
5 | "UUID" varchar(255) NOT NULL Primary key, | ||
6 | "RegionUUID" varchar(255) NULL, | ||
7 | "ParentID" int NULL, | ||
8 | "CreationDate" int NULL, | ||
9 | "Name" varchar(255) NULL, | ||
10 | "SceneGroupID" varchar(255) NULL, | ||
11 | "Text" varchar(255) NULL, | ||
12 | "Description" varchar(255) NULL, | ||
13 | "SitName" varchar(255) NULL, | ||
14 | "TouchName" varchar(255) NULL, | ||
15 | "ObjectFlags" int NULL, | ||
16 | "CreatorID" varchar(255) NULL, | ||
17 | "OwnerID" varchar(255) NULL, | ||
18 | "GroupID" varchar(255) NULL, | ||
19 | "LastOwnerID" varchar(255) NULL, | ||
20 | "OwnerMask" int NULL, | ||
21 | "NextOwnerMask" int NULL, | ||
22 | "GroupMask" int NULL, | ||
23 | "EveryoneMask" int NULL, | ||
24 | "BaseMask" int NULL, | ||
25 | "PositionX" double precision NULL, | ||
26 | "PositionY" double precision NULL, | ||
27 | "PositionZ" double precision NULL, | ||
28 | "GroupPositionX" double precision NULL, | ||
29 | "GroupPositionY" double precision NULL, | ||
30 | "GroupPositionZ" double precision NULL, | ||
31 | "VelocityX" double precision NULL, | ||
32 | "VelocityY" double precision NULL, | ||
33 | "VelocityZ" double precision NULL, | ||
34 | "AngularVelocityX" double precision NULL, | ||
35 | "AngularVelocityY" double precision NULL, | ||
36 | "AngularVelocityZ" double precision NULL, | ||
37 | "AccelerationX" double precision NULL, | ||
38 | "AccelerationY" double precision NULL, | ||
39 | "AccelerationZ" double precision NULL, | ||
40 | "RotationX" double precision NULL, | ||
41 | "RotationY" double precision NULL, | ||
42 | "RotationZ" double precision NULL, | ||
43 | "RotationW" double precision NULL, | ||
44 | "SitTargetOffsetX" double precision NULL, | ||
45 | "SitTargetOffsetY" double precision NULL, | ||
46 | "SitTargetOffsetZ" double precision NULL, | ||
47 | "SitTargetOrientW" double precision NULL, | ||
48 | "SitTargetOrientX" double precision NULL, | ||
49 | "SitTargetOrientY" double precision NULL, | ||
50 | "SitTargetOrientZ" double precision NULL | ||
51 | ); | ||
52 | |||
53 | CREATE TABLE primshapes( | ||
54 | "UUID" varchar(255) NOT NULL primary key, | ||
55 | "Shape" int NULL, | ||
56 | "ScaleX" double precision NULL, | ||
57 | "ScaleY" double precision NULL, | ||
58 | "ScaleZ" double precision NULL, | ||
59 | "PCode" int NULL, | ||
60 | "PathBegin" int NULL, | ||
61 | "PathEnd" int NULL, | ||
62 | "PathScaleX" int NULL, | ||
63 | "PathScaleY" int NULL, | ||
64 | "PathShearX" int NULL, | ||
65 | "PathShearY" int NULL, | ||
66 | "PathSkew" int NULL, | ||
67 | "PathCurve" int NULL, | ||
68 | "PathRadiusOffset" int NULL, | ||
69 | "PathRevolutions" int NULL, | ||
70 | "PathTaperX" int NULL, | ||
71 | "PathTaperY" int NULL, | ||
72 | "PathTwist" int NULL, | ||
73 | "PathTwistBegin" int NULL, | ||
74 | "ProfileBegin" int NULL, | ||
75 | "ProfileEnd" int NULL, | ||
76 | "ProfileCurve" int NULL, | ||
77 | "ProfileHollow" int NULL, | ||
78 | "State" int NULL, | ||
79 | "Texture" bytea NULL, | ||
80 | "ExtraParams" bytea NULL | ||
81 | ); | ||
82 | |||
83 | CREATE TABLE primitems( | ||
84 | "itemID" varchar(255) NOT NULL primary key, | ||
85 | "primID" varchar(255) NULL, | ||
86 | "assetID" varchar(255) NULL, | ||
87 | "parentFolderID" varchar(255) NULL, | ||
88 | "invType" int NULL, | ||
89 | "assetType" int NULL, | ||
90 | "name" varchar(255) NULL, | ||
91 | "description" varchar(255) NULL, | ||
92 | "creationDate" varchar(255) NULL, | ||
93 | "creatorID" varchar(255) NULL, | ||
94 | "ownerID" varchar(255) NULL, | ||
95 | "lastOwnerID" varchar(255) NULL, | ||
96 | "groupID" varchar(255) NULL, | ||
97 | "nextPermissions" int NULL, | ||
98 | "currentPermissions" int NULL, | ||
99 | "basePermissions" int NULL, | ||
100 | "everyonePermissions" int NULL, | ||
101 | "groupPermissions" int NULL | ||
102 | ); | ||
103 | |||
104 | CREATE TABLE terrain( | ||
105 | "RegionUUID" varchar(255) NULL, | ||
106 | "Revision" int NULL, | ||
107 | "Heightfield" bytea NULL | ||
108 | ); | ||
109 | |||
110 | |||
111 | CREATE TABLE land( | ||
112 | "UUID" varchar(255) NOT NULL primary key, | ||
113 | "RegionUUID" varchar(255) NULL, | ||
114 | "LocalLandID" int NULL, | ||
115 | "Bitmap" bytea NULL, | ||
116 | "Name" varchar(255) NULL, | ||
117 | "Description" varchar(255) NULL, | ||
118 | "OwnerUUID" varchar(255) NULL, | ||
119 | "IsGroupOwned" boolean NULL, | ||
120 | "Area" int NULL, | ||
121 | "AuctionID" int NULL, | ||
122 | "Category" int NULL, | ||
123 | "ClaimDate" int NULL, | ||
124 | "ClaimPrice" int NULL, | ||
125 | "GroupUUID" varchar(255) NULL, | ||
126 | "SalePrice" int NULL, | ||
127 | "LandStatus" int NULL, | ||
128 | "LandFlags" int NULL, | ||
129 | "LandingType" int NULL, | ||
130 | "MediaAutoScale" int NULL, | ||
131 | "MediaTextureUUID" varchar(255) NULL, | ||
132 | "MediaURL" varchar(255) NULL, | ||
133 | "MusicURL" varchar(255) NULL, | ||
134 | "PassHours" double precision NULL, | ||
135 | "PassPrice" int NULL, | ||
136 | "SnapshotUUID" varchar(255) NULL, | ||
137 | "UserLocationX" double precision NULL, | ||
138 | "UserLocationY" double precision NULL, | ||
139 | "UserLocationZ" double precision NULL, | ||
140 | "UserLookAtX" double precision NULL, | ||
141 | "UserLookAtY" double precision NULL, | ||
142 | "UserLookAtZ" double precision NULL | ||
143 | ); | ||
144 | |||
145 | Create index on land (lower("Name")); | ||
146 | |||
147 | CREATE TABLE landaccesslist( | ||
148 | "LandUUID" varchar(255) NULL, | ||
149 | "AccessUUID" varchar(255) NULL, | ||
150 | "Flags" int NULL | ||
151 | ); | ||
152 | |||
153 | COMMIT; | ||
154 | |||
155 | :VERSION 2 | ||
156 | |||
157 | BEGIN TRANSACTION; | ||
158 | |||
159 | CREATE TABLE regionban ( | ||
160 | "regionUUID" VARCHAR(36) NOT NULL, | ||
161 | "bannedUUID" VARCHAR(36) NOT NULL, | ||
162 | "bannedIp" VARCHAR(16) NOT NULL, | ||
163 | "bannedIpHostMask" VARCHAR(16) NOT NULL | ||
164 | ); | ||
165 | |||
166 | create table regionsettings ( | ||
167 | "regionUUID" varchar(36) not null primary key, | ||
168 | "block_terraform" boolean not null, | ||
169 | "block_fly" boolean not null, | ||
170 | "allow_damage" boolean not null, | ||
171 | "restrict_pushing" boolean not null, | ||
172 | "allow_land_resell" boolean not null, | ||
173 | "allow_land_join_divide" boolean not null, | ||
174 | "block_show_in_search" boolean not null, | ||
175 | "agent_limit" int not null, | ||
176 | "object_bonus" double precision not null, | ||
177 | "maturity" int not null, | ||
178 | "disable_scripts" boolean not null, | ||
179 | "disable_collisions" boolean not null, | ||
180 | "disable_physics" boolean not null, | ||
181 | "terrain_texture_1" varchar(36) not null, | ||
182 | "terrain_texture_2" varchar(36) not null, | ||
183 | "terrain_texture_3" varchar(36) not null, | ||
184 | "terrain_texture_4" varchar(36) not null, | ||
185 | "elevation_1_nw" double precision not null, | ||
186 | "elevation_2_nw" double precision not null, | ||
187 | "elevation_1_ne" double precision not null, | ||
188 | "elevation_2_ne" double precision not null, | ||
189 | "elevation_1_se" double precision not null, | ||
190 | "elevation_2_se" double precision not null, | ||
191 | "elevation_1_sw" double precision not null, | ||
192 | "elevation_2_sw" double precision not null, | ||
193 | "water_height" double precision not null, | ||
194 | "terrain_raise_limit" double precision not null, | ||
195 | "terrain_lower_limit" double precision not null, | ||
196 | "use_estate_sun" boolean not null, | ||
197 | "fixed_sun" boolean not null, | ||
198 | "sun_position" double precision not null, | ||
199 | "covenant" varchar(36) default NULL, | ||
200 | "Sandbox" boolean NOT NULL | ||
201 | ); | ||
202 | |||
203 | COMMIT; | ||
204 | |||
205 | :VERSION 3 | ||
206 | |||
207 | BEGIN TRANSACTION; | ||
208 | |||
209 | CREATE TABLE Tmp_prims | ||
210 | ( | ||
211 | "UUID" varchar(36) NOT NULL , | ||
212 | "RegionUUID" varchar(36) NULL, | ||
213 | "ParentID" int NULL, | ||
214 | "CreationDate" int NULL, | ||
215 | "Name" varchar(255) NULL, | ||
216 | "SceneGroupID" varchar(36) NULL, | ||
217 | "Text" varchar(255) NULL, | ||
218 | "Description" varchar(255) NULL, | ||
219 | "SitName" varchar(255) NULL, | ||
220 | "TouchName" varchar(255) NULL, | ||
221 | "ObjectFlags" int NULL, | ||
222 | "CreatorID" varchar(36) NULL, | ||
223 | "OwnerID" varchar(36) NULL, | ||
224 | "GroupID" varchar(36) NULL, | ||
225 | "LastOwnerID" varchar(36) NULL, | ||
226 | "OwnerMask" int NULL, | ||
227 | "NextOwnerMask" int NULL, | ||
228 | "GroupMask" int NULL, | ||
229 | "EveryoneMask" int NULL, | ||
230 | "BaseMask" int NULL, | ||
231 | "PositionX" double precision NULL, | ||
232 | "PositionY" double precision NULL, | ||
233 | "PositionZ" double precision NULL, | ||
234 | "GroupPositionX" double precision NULL, | ||
235 | "GroupPositionY" double precision NULL, | ||
236 | "GroupPositionZ" double precision NULL, | ||
237 | "VelocityX" double precision NULL, | ||
238 | "VelocityY" double precision NULL, | ||
239 | "VelocityZ" double precision NULL, | ||
240 | "AngularVelocityX" double precision NULL, | ||
241 | "AngularVelocityY" double precision NULL, | ||
242 | "AngularVelocityZ" double precision NULL, | ||
243 | "AccelerationX" double precision NULL, | ||
244 | "AccelerationY" double precision NULL, | ||
245 | "AccelerationZ" double precision NULL, | ||
246 | "RotationX" double precision NULL, | ||
247 | "RotationY" double precision NULL, | ||
248 | "RotationZ" double precision NULL, | ||
249 | "RotationW" double precision NULL, | ||
250 | "SitTargetOffsetX" double precision NULL, | ||
251 | "SitTargetOffsetY" double precision NULL, | ||
252 | "SitTargetOffsetZ" double precision NULL, | ||
253 | "SitTargetOrientW" double precision NULL, | ||
254 | "SitTargetOrientX" double precision NULL, | ||
255 | "SitTargetOrientY" double precision NULL, | ||
256 | "SitTargetOrientZ" double precision NULL | ||
257 | ); | ||
258 | |||
259 | INSERT INTO Tmp_prims ("UUID", "RegionUUID", "ParentID", "CreationDate", "Name", "SceneGroupID", "Text", "Description", "SitName", "TouchName", "ObjectFlags", "CreatorID", "OwnerID", "GroupID", "LastOwnerID", "OwnerMask", "NextOwnerMask", "GroupMask", "EveryoneMask", "BaseMask", "PositionX", "PositionY", "PositionZ", "GroupPositionX", "GroupPositionY", "GroupPositionZ", "VelocityX", "VelocityY", "VelocityZ", "AngularVelocityX", "AngularVelocityY", "AngularVelocityZ", "AccelerationX", "AccelerationY", "AccelerationZ", "RotationX", "RotationY", "RotationZ", "RotationW", "SitTargetOffsetX", "SitTargetOffsetY", "SitTargetOffsetZ", "SitTargetOrientW", "SitTargetOrientX", "SitTargetOrientY", "SitTargetOrientZ") | ||
260 | SELECT cast("UUID" as varchar(36)), cast("RegionUUID" as varchar(36)), "ParentID", "CreationDate", "Name", cast("SceneGroupID" as varchar(36)), "Text", "Description", "SitName", "TouchName", "ObjectFlags", cast("CreatorID" as varchar(36)), cast("OwnerID" as varchar(36)), cast( "GroupID" as varchar(36)), cast("LastOwnerID" as varchar(36)), "OwnerMask", "NextOwnerMask", "GroupMask", "EveryoneMask", "BaseMask", "PositionX", "PositionY", "PositionZ", "GroupPositionX", "GroupPositionY", "GroupPositionZ", "VelocityX", "VelocityY", "VelocityZ", "AngularVelocityX", "AngularVelocityY", "AngularVelocityZ", "AccelerationX", "AccelerationY", "AccelerationZ", "RotationX", "RotationY", "RotationZ", "RotationW", "SitTargetOffsetX", "SitTargetOffsetY", "SitTargetOffsetZ", "SitTargetOrientW", "SitTargetOrientX", "SitTargetOrientY", "SitTargetOrientZ" | ||
261 | FROM prims ; | ||
262 | |||
263 | DROP TABLE prims; | ||
264 | |||
265 | alter table Tmp_prims rename to prims; | ||
266 | |||
267 | |||
268 | ALTER TABLE prims ADD CONSTRAINT | ||
269 | PK__prims__10566F31 PRIMARY KEY | ||
270 | ( | ||
271 | "UUID" | ||
272 | ); | ||
273 | |||
274 | COMMIT; | ||
275 | |||
276 | :VERSION 4 | ||
277 | |||
278 | BEGIN TRANSACTION; | ||
279 | |||
280 | CREATE TABLE Tmp_primitems | ||
281 | ( | ||
282 | "itemID" varchar(36) NOT NULL, | ||
283 | "primID" varchar(36) NULL, | ||
284 | "assetID" varchar(36) NULL, | ||
285 | "parentFolderID" varchar(36) NULL, | ||
286 | "invType" int NULL, | ||
287 | "assetType" int NULL, | ||
288 | "name" varchar(255) NULL, | ||
289 | "description" varchar(255) NULL, | ||
290 | "creationDate" varchar(255) NULL, | ||
291 | "creatorID" varchar(36) NULL, | ||
292 | "ownerID" varchar(36) NULL, | ||
293 | "lastOwnerID" varchar(36) NULL, | ||
294 | "groupID" varchar(36) NULL, | ||
295 | "nextPermissions" int NULL, | ||
296 | "currentPermissions" int NULL, | ||
297 | "basePermissions" int NULL, | ||
298 | "everyonePermissions" int NULL, | ||
299 | "groupPermissions" int NULL | ||
300 | ); | ||
301 | |||
302 | INSERT INTO Tmp_primitems ("itemID", "primID", "assetID", "parentFolderID", "invType", "assetType", "name", "description", "creationDate", "creatorID", "ownerID", "lastOwnerID", "groupID", "nextPermissions", "currentPermissions", "basePermissions", "everyonePermissions", "groupPermissions") | ||
303 | SELECT cast("itemID" as varchar(36)), cast("primID" as varchar(36)), cast("assetID" as varchar(36)), cast( "parentFolderID" as varchar(36)), "invType", "assetType", "name", "description", "creationDate", cast( "creatorID" as varchar(36)), cast("ownerID" as varchar(36)), cast("lastOwnerID" as varchar(36)), cast("groupID" as varchar(36)), "nextPermissions", "currentPermissions", "basePermissions", "everyonePermissions", "groupPermissions" | ||
304 | from primitems; | ||
305 | |||
306 | DROP TABLE primitems; | ||
307 | |||
308 | alter table Tmp_primitems rename to primitems; | ||
309 | |||
310 | ALTER TABLE primitems ADD CONSTRAINT | ||
311 | PK__primitems__0A688BB1 PRIMARY KEY | ||
312 | ( | ||
313 | "itemID" | ||
314 | ); | ||
315 | |||
316 | |||
317 | COMMIT; | ||
318 | |||
319 | |||
320 | :VERSION 5 | ||
321 | |||
322 | BEGIN TRANSACTION; | ||
323 | |||
324 | CREATE TABLE Tmp_primshapes | ||
325 | ( | ||
326 | "UUID" varchar(36) NOT NULL, | ||
327 | "Shape" int NULL, | ||
328 | "ScaleX" double precision NULL, | ||
329 | "ScaleY" double precision NULL, | ||
330 | "ScaleZ" double precision NULL, | ||
331 | "PCode" int NULL, | ||
332 | "PathBegin" int NULL, | ||
333 | "PathEnd" int NULL, | ||
334 | "PathScaleX" int NULL, | ||
335 | "PathScaleY" int NULL, | ||
336 | "PathShearX" int NULL, | ||
337 | "PathShearY" int NULL, | ||
338 | "PathSkew" int NULL, | ||
339 | "PathCurve" int NULL, | ||
340 | "PathRadiusOffset" int NULL, | ||
341 | "PathRevolutions" int NULL, | ||
342 | "PathTaperX" int NULL, | ||
343 | "PathTaperY" int NULL, | ||
344 | "PathTwist" int NULL, | ||
345 | "PathTwistBegin" int NULL, | ||
346 | "ProfileBegin" int NULL, | ||
347 | "ProfileEnd" int NULL, | ||
348 | "ProfileCurve" int NULL, | ||
349 | "ProfileHollow" int NULL, | ||
350 | "State" int NULL, | ||
351 | "Texture" bytea NULL, | ||
352 | "ExtraParams" bytea NULL | ||
353 | ) ; | ||
354 | |||
355 | INSERT INTO Tmp_primshapes ("UUID", "Shape", "ScaleX", "ScaleY", "ScaleZ", "PCode", "PathBegin", "PathEnd", "PathScaleX", "PathScaleY", "PathShearX", "PathShearY", "PathSkew", "PathCurve", "PathRadiusOffset", "PathRevolutions", "PathTaperX", "PathTaperY", "PathTwist", "PathTwistBegin", "ProfileBegin", "ProfileEnd", "ProfileCurve", "ProfileHollow", "State", "Texture", "ExtraParams") | ||
356 | SELECT cast("UUID" as varchar(36)), "Shape", "ScaleX", "ScaleY", "ScaleZ", "PCode", "PathBegin", "PathEnd", "PathScaleX", "PathScaleY", "PathShearX", "PathShearY", "PathSkew", "PathCurve", "PathRadiusOffset", "PathRevolutions", "PathTaperX", "PathTaperY", "PathTwist", "PathTwistBegin", "ProfileBegin", "ProfileEnd", "ProfileCurve", "ProfileHollow", "State", "Texture", "ExtraParams" | ||
357 | FROM primshapes; | ||
358 | |||
359 | DROP TABLE primshapes; | ||
360 | |||
361 | alter table Tmp_primshapes rename to primshapes; | ||
362 | |||
363 | ALTER TABLE primshapes ADD CONSTRAINT | ||
364 | PK__primshapes__0880433F PRIMARY KEY | ||
365 | ( | ||
366 | "UUID" | ||
367 | ) ; | ||
368 | |||
369 | COMMIT; | ||
370 | |||
371 | |||
372 | :VERSION 6 | ||
373 | |||
374 | BEGIN TRANSACTION; | ||
375 | |||
376 | ALTER TABLE prims ADD "PayPrice" int not null default 0; | ||
377 | ALTER TABLE prims ADD "PayButton1" int not null default 0; | ||
378 | ALTER TABLE prims ADD "PayButton2" int not null default 0; | ||
379 | ALTER TABLE prims ADD "PayButton3" int not null default 0; | ||
380 | ALTER TABLE prims ADD "PayButton4" int not null default 0; | ||
381 | ALTER TABLE prims ADD "LoopedSound" varchar(36) not null default '00000000-0000-0000-0000-000000000000'; | ||
382 | ALTER TABLE prims ADD "LoopedSoundGain" double precision not null default 0.0; | ||
383 | ALTER TABLE prims ADD "TextureAnimation" bytea; | ||
384 | ALTER TABLE prims ADD "OmegaX" double precision not null default 0.0; | ||
385 | ALTER TABLE prims ADD "OmegaY" double precision not null default 0.0; | ||
386 | ALTER TABLE prims ADD "OmegaZ" double precision not null default 0.0; | ||
387 | ALTER TABLE prims ADD "CameraEyeOffsetX" double precision not null default 0.0; | ||
388 | ALTER TABLE prims ADD "CameraEyeOffsetY" double precision not null default 0.0; | ||
389 | ALTER TABLE prims ADD "CameraEyeOffsetZ" double precision not null default 0.0; | ||
390 | ALTER TABLE prims ADD "CameraAtOffsetX" double precision not null default 0.0; | ||
391 | ALTER TABLE prims ADD "CameraAtOffsetY" double precision not null default 0.0; | ||
392 | ALTER TABLE prims ADD "CameraAtOffsetZ" double precision not null default 0.0; | ||
393 | ALTER TABLE prims ADD "ForceMouselook" smallint not null default 0; | ||
394 | ALTER TABLE prims ADD "ScriptAccessPin" int not null default 0; | ||
395 | ALTER TABLE prims ADD "AllowedDrop" smallint not null default 0; | ||
396 | ALTER TABLE prims ADD "DieAtEdge" smallint not null default 0; | ||
397 | ALTER TABLE prims ADD "SalePrice" int not null default 10; | ||
398 | ALTER TABLE prims ADD "SaleType" smallint not null default 0; | ||
399 | |||
400 | ALTER TABLE primitems add "flags" integer not null default 0; | ||
401 | |||
402 | ALTER TABLE land ADD "AuthbuyerID" varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000'; | ||
403 | |||
404 | CREATE index prims_regionuuid on prims("RegionUUID"); | ||
405 | CREATE index prims_parentid on prims("ParentID"); | ||
406 | |||
407 | CREATE index primitems_primid on primitems("primID"); | ||
408 | |||
409 | COMMIT; | ||
410 | |||
411 | |||
412 | :VERSION 7 | ||
413 | |||
414 | BEGIN TRANSACTION; | ||
415 | |||
416 | ALTER TABLE prims ADD "ColorR" int not null default 0; | ||
417 | ALTER TABLE prims ADD "ColorG" int not null default 0; | ||
418 | ALTER TABLE prims ADD "ColorB" int not null default 0; | ||
419 | ALTER TABLE prims ADD "ColorA" int not null default 0; | ||
420 | ALTER TABLE prims ADD "ParticleSystem" bytea; | ||
421 | ALTER TABLE prims ADD "ClickAction" smallint NOT NULL default 0; | ||
422 | |||
423 | COMMIT; | ||
424 | |||
425 | |||
426 | :VERSION 8 | ||
427 | |||
428 | BEGIN TRANSACTION; | ||
429 | |||
430 | ALTER TABLE land ADD "OtherCleanTime" integer NOT NULL default 0; | ||
431 | ALTER TABLE land ADD "Dwell" integer NOT NULL default 0; | ||
432 | |||
433 | COMMIT; | ||
434 | |||
435 | :VERSION 9 | ||
436 | |||
437 | BEGIN TRANSACTION; | ||
438 | |||
439 | ALTER TABLE prims ADD "Material" smallint NOT NULL default 3; | ||
440 | |||
441 | COMMIT; | ||
442 | |||
443 | |||
444 | :VERSION 10 | ||
445 | |||
446 | BEGIN TRANSACTION; | ||
447 | |||
448 | ALTER TABLE regionsettings ADD "sunvectorx" double precision NOT NULL default 0; | ||
449 | ALTER TABLE regionsettings ADD "sunvectory" double precision NOT NULL default 0; | ||
450 | ALTER TABLE regionsettings ADD "sunvectorz" double precision NOT NULL default 0; | ||
451 | |||
452 | COMMIT; | ||
453 | |||
454 | |||
455 | :VERSION 11 | ||
456 | |||
457 | BEGIN TRANSACTION; | ||
458 | |||
459 | ALTER TABLE prims ADD "CollisionSound" char(36) not null default '00000000-0000-0000-0000-000000000000'; | ||
460 | ALTER TABLE prims ADD "CollisionSoundVolume" double precision not null default 0.0; | ||
461 | |||
462 | COMMIT; | ||
463 | |||
464 | |||
465 | :VERSION 12 | ||
466 | |||
467 | BEGIN TRANSACTION; | ||
468 | |||
469 | ALTER TABLE prims ADD "LinkNumber" integer not null default 0; | ||
470 | |||
471 | COMMIT; | ||
472 | |||
473 | |||
474 | :VERSION 13 | ||
475 | |||
476 | BEGIN TRANSACTION; | ||
477 | |||
478 | CREATE TABLE Tmp_prims | ||
479 | ( | ||
480 | "UUID" uuid NOT NULL, | ||
481 | "RegionUUID" uuid NULL, | ||
482 | "ParentID" int NULL, | ||
483 | "CreationDate" int NULL, | ||
484 | "Name" varchar(255) NULL, | ||
485 | "SceneGroupID" uuid NULL, | ||
486 | "Text" varchar(255) NULL, | ||
487 | "Description" varchar(255) NULL, | ||
488 | "SitName" varchar(255) NULL, | ||
489 | "TouchName" varchar(255) NULL, | ||
490 | "ObjectFlags" int NULL, | ||
491 | "CreatorID" uuid NULL, | ||
492 | "OwnerID" uuid NULL, | ||
493 | "GroupID" uuid NULL, | ||
494 | "LastOwnerID" uuid NULL, | ||
495 | "OwnerMask" int NULL, | ||
496 | "NextOwnerMask" int NULL, | ||
497 | "GroupMask" int NULL, | ||
498 | "EveryoneMask" int NULL, | ||
499 | "BaseMask" int NULL, | ||
500 | "PositionX" double precision NULL, | ||
501 | "PositionY" double precision NULL, | ||
502 | "PositionZ" double precision NULL, | ||
503 | "GroupPositionX" double precision NULL, | ||
504 | "GroupPositionY" double precision NULL, | ||
505 | "GroupPositionZ" double precision NULL, | ||
506 | "VelocityX" double precision NULL, | ||
507 | "VelocityY" double precision NULL, | ||
508 | "VelocityZ" double precision NULL, | ||
509 | "AngularVelocityX" double precision NULL, | ||
510 | "AngularVelocityY" double precision NULL, | ||
511 | "AngularVelocityZ" double precision NULL, | ||
512 | "AccelerationX" double precision NULL, | ||
513 | "AccelerationY" double precision NULL, | ||
514 | "AccelerationZ" double precision NULL, | ||
515 | "RotationX" double precision NULL, | ||
516 | "RotationY" double precision NULL, | ||
517 | "RotationZ" double precision NULL, | ||
518 | "RotationW" double precision NULL, | ||
519 | "SitTargetOffsetX" double precision NULL, | ||
520 | "SitTargetOffsetY" double precision NULL, | ||
521 | "SitTargetOffsetZ" double precision NULL, | ||
522 | "SitTargetOrientW" double precision NULL, | ||
523 | "SitTargetOrientX" double precision NULL, | ||
524 | "SitTargetOrientY" double precision NULL, | ||
525 | "SitTargetOrientZ" double precision NULL, | ||
526 | "PayPrice" int NOT NULL DEFAULT ((0)), | ||
527 | "PayButton1" int NOT NULL DEFAULT ((0)), | ||
528 | "PayButton2" int NOT NULL DEFAULT ((0)), | ||
529 | "PayButton3" int NOT NULL DEFAULT ((0)), | ||
530 | "PayButton4" int NOT NULL DEFAULT ((0)), | ||
531 | "LoopedSound" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), | ||
532 | "LoopedSoundGain" double precision NOT NULL DEFAULT ((0.0)), | ||
533 | "TextureAnimation" bytea NULL, | ||
534 | "OmegaX" double precision NOT NULL DEFAULT ((0.0)), | ||
535 | "OmegaY" double precision NOT NULL DEFAULT ((0.0)), | ||
536 | "OmegaZ" double precision NOT NULL DEFAULT ((0.0)), | ||
537 | "CameraEyeOffsetX" double precision NOT NULL DEFAULT ((0.0)), | ||
538 | "CameraEyeOffsetY" double precision NOT NULL DEFAULT ((0.0)), | ||
539 | "CameraEyeOffsetZ" double precision NOT NULL DEFAULT ((0.0)), | ||
540 | "CameraAtOffsetX" double precision NOT NULL DEFAULT ((0.0)), | ||
541 | "CameraAtOffsetY" double precision NOT NULL DEFAULT ((0.0)), | ||
542 | "CameraAtOffsetZ" double precision NOT NULL DEFAULT ((0.0)), | ||
543 | "ForceMouselook" smallint NOT NULL DEFAULT ((0)), | ||
544 | "ScriptAccessPin" int NOT NULL DEFAULT ((0)), | ||
545 | "AllowedDrop" smallint NOT NULL DEFAULT ((0)), | ||
546 | "DieAtEdge" smallint NOT NULL DEFAULT ((0)), | ||
547 | "SalePrice" int NOT NULL DEFAULT ((10)), | ||
548 | "SaleType" smallint NOT NULL DEFAULT ((0)), | ||
549 | "ColorR" int NOT NULL DEFAULT ((0)), | ||
550 | "ColorG" int NOT NULL DEFAULT ((0)), | ||
551 | "ColorB" int NOT NULL DEFAULT ((0)), | ||
552 | "ColorA" int NOT NULL DEFAULT ((0)), | ||
553 | "ParticleSystem" bytea NULL, | ||
554 | "ClickAction" smallint NOT NULL DEFAULT ((0)), | ||
555 | "Material" smallint NOT NULL DEFAULT ((3)), | ||
556 | "CollisionSound" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), | ||
557 | "CollisionSoundVolume" double precision NOT NULL DEFAULT ((0.0)), | ||
558 | "LinkNumber" int NOT NULL DEFAULT ((0)) | ||
559 | ); | ||
560 | |||
561 | INSERT INTO Tmp_prims ("UUID", "RegionUUID", "ParentID", "CreationDate", "Name", "SceneGroupID", "Text", "Description", "SitName", "TouchName", "ObjectFlags", "CreatorID", "OwnerID", "GroupID", "LastOwnerID", "OwnerMask", "NextOwnerMask", "GroupMask", "EveryoneMask", "BaseMask", "PositionX", "PositionY", "PositionZ", "GroupPositionX", "GroupPositionY", "GroupPositionZ", "VelocityX", "VelocityY", "VelocityZ", "AngularVelocityX", "AngularVelocityY", "AngularVelocityZ", "AccelerationX", "AccelerationY", "AccelerationZ", "RotationX", "RotationY", "RotationZ", "RotationW", "SitTargetOffsetX", "SitTargetOffsetY", "SitTargetOffsetZ", "SitTargetOrientW", "SitTargetOrientX", "SitTargetOrientY", "SitTargetOrientZ", "PayPrice", "PayButton1", "PayButton2", "PayButton3", "PayButton4", "LoopedSound", "LoopedSoundGain", "TextureAnimation", "OmegaX", "OmegaY", "OmegaZ", "CameraEyeOffsetX", "CameraEyeOffsetY", "CameraEyeOffsetZ", "CameraAtOffsetX", "CameraAtOffsetY", "CameraAtOffsetZ", "ForceMouselook", "ScriptAccessPin", "AllowedDrop", "DieAtEdge", "SalePrice", "SaleType", "ColorR", "ColorG", "ColorB", "ColorA", "ParticleSystem", "ClickAction", "Material", "CollisionSound", "CollisionSoundVolume", "LinkNumber") | ||
562 | SELECT cast("UUID" as uuid), cast("RegionUUID" as uuid), "ParentID", "CreationDate", "Name", cast("SceneGroupID" as uuid), "Text", "Description", "SitName", "TouchName", "ObjectFlags", cast("CreatorID" as uuid), cast("OwnerID" as uuid), cast("GroupID" as uuid), cast("LastOwnerID" as uuid), "OwnerMask", "NextOwnerMask", "GroupMask", "EveryoneMask", "BaseMask", "PositionX", "PositionY", "PositionZ", "GroupPositionX", "GroupPositionY", "GroupPositionZ", "VelocityX", "VelocityY", "VelocityZ", "AngularVelocityX", "AngularVelocityY", "AngularVelocityZ", "AccelerationX", "AccelerationY", "AccelerationZ", "RotationX", "RotationY", "RotationZ", "RotationW", "SitTargetOffsetX", "SitTargetOffsetY", "SitTargetOffsetZ", "SitTargetOrientW", "SitTargetOrientX", "SitTargetOrientY", "SitTargetOrientZ", "PayPrice", "PayButton1", "PayButton2", "PayButton3", "PayButton4", cast("LoopedSound" as uuid), "LoopedSoundGain", "TextureAnimation", "OmegaX", "OmegaY", "OmegaZ", "CameraEyeOffsetX", "CameraEyeOffsetY", "CameraEyeOffsetZ", "CameraAtOffsetX", "CameraAtOffsetY", "CameraAtOffsetZ", "ForceMouselook", "ScriptAccessPin", "AllowedDrop", "DieAtEdge", "SalePrice", "SaleType", "ColorR", "ColorG", "ColorB", "ColorA", "ParticleSystem", "ClickAction", "Material", cast("CollisionSound" as uuid), "CollisionSoundVolume", "LinkNumber" | ||
563 | FROM prims ; | ||
564 | |||
565 | DROP TABLE prims; | ||
566 | |||
567 | alter table Tmp_prims rename to prims; | ||
568 | |||
569 | ALTER TABLE prims ADD CONSTRAINT | ||
570 | PK__prims__10566F31 PRIMARY KEY | ||
571 | ( | ||
572 | "UUID" | ||
573 | ); | ||
574 | |||
575 | |||
576 | CREATE INDEX prims_regionuuid ON prims | ||
577 | ( | ||
578 | "RegionUUID" | ||
579 | ); | ||
580 | |||
581 | CREATE INDEX prims_parentid ON prims | ||
582 | ( | ||
583 | "ParentID" | ||
584 | ); | ||
585 | |||
586 | COMMIT; | ||
587 | |||
588 | |||
589 | :VERSION 14 | ||
590 | |||
591 | BEGIN TRANSACTION; | ||
592 | |||
593 | CREATE TABLE Tmp_primshapes | ||
594 | ( | ||
595 | "UUID" uuid NOT NULL, | ||
596 | "Shape" int NULL, | ||
597 | "ScaleX" double precision NULL, | ||
598 | "ScaleY" double precision NULL, | ||
599 | "ScaleZ" double precision NULL, | ||
600 | "PCode" int NULL, | ||
601 | "PathBegin" int NULL, | ||
602 | "PathEnd" int NULL, | ||
603 | "PathScaleX" int NULL, | ||
604 | "PathScaleY" int NULL, | ||
605 | "PathShearX" int NULL, | ||
606 | "PathShearY" int NULL, | ||
607 | "PathSkew" int NULL, | ||
608 | "PathCurve" int NULL, | ||
609 | "PathRadiusOffset" int NULL, | ||
610 | "PathRevolutions" int NULL, | ||
611 | "PathTaperX" int NULL, | ||
612 | "PathTaperY" int NULL, | ||
613 | "PathTwist" int NULL, | ||
614 | "PathTwistBegin" int NULL, | ||
615 | "ProfileBegin" int NULL, | ||
616 | "ProfileEnd" int NULL, | ||
617 | "ProfileCurve" int NULL, | ||
618 | "ProfileHollow" int NULL, | ||
619 | "State" int NULL, | ||
620 | "Texture" bytea NULL, | ||
621 | "ExtraParams" bytea NULL | ||
622 | ); | ||
623 | |||
624 | INSERT INTO Tmp_primshapes ("UUID", "Shape", "ScaleX", "ScaleY", "ScaleZ", "PCode", "PathBegin", "PathEnd", "PathScaleX", "PathScaleY", "PathShearX", "PathShearY", "PathSkew", "PathCurve", "PathRadiusOffset", "PathRevolutions", "PathTaperX", "PathTaperY", "PathTwist", "PathTwistBegin", "ProfileBegin", "ProfileEnd", "ProfileCurve", "ProfileHollow", "State", "Texture", "ExtraParams") | ||
625 | SELECT cast("UUID" as uuid), "Shape", "ScaleX", "ScaleY", "ScaleZ", "PCode", "PathBegin", "PathEnd", "PathScaleX", "PathScaleY", "PathShearX", "PathShearY", "PathSkew", "PathCurve", "PathRadiusOffset", "PathRevolutions", "PathTaperX", "PathTaperY", "PathTwist", "PathTwistBegin", "ProfileBegin", "ProfileEnd", "ProfileCurve", "ProfileHollow", "State", "Texture", "ExtraParams" | ||
626 | FROM primshapes; | ||
627 | |||
628 | DROP TABLE primshapes; | ||
629 | |||
630 | alter table Tmp_primshapes rename to primshapes; | ||
631 | |||
632 | ALTER TABLE primshapes ADD CONSTRAINT | ||
633 | PK__primshapes__0880433F PRIMARY KEY | ||
634 | ( | ||
635 | "UUID" | ||
636 | ); | ||
637 | |||
638 | COMMIT; | ||
639 | |||
640 | |||
641 | :VERSION 15 | ||
642 | |||
643 | BEGIN TRANSACTION; | ||
644 | |||
645 | CREATE TABLE Tmp_primitems | ||
646 | ( | ||
647 | "itemID" uuid NOT NULL, | ||
648 | "primID" uuid NULL, | ||
649 | "assetID" uuid NULL, | ||
650 | "parentFolderID" uuid NULL, | ||
651 | "invType" int NULL, | ||
652 | "assetType" int NULL, | ||
653 | "name" varchar(255) NULL, | ||
654 | "description" varchar(255) NULL, | ||
655 | "creationDate" varchar(255) NULL, | ||
656 | "creatorID" uuid NULL, | ||
657 | "ownerID" uuid NULL, | ||
658 | "lastOwnerID" uuid NULL, | ||
659 | "groupID" uuid NULL, | ||
660 | "nextPermissions" int NULL, | ||
661 | "currentPermissions" int NULL, | ||
662 | "basePermissions" int NULL, | ||
663 | "everyonePermissions" int NULL, | ||
664 | "groupPermissions" int NULL, | ||
665 | flags int NOT NULL DEFAULT ((0)) | ||
666 | ); | ||
667 | |||
668 | INSERT INTO Tmp_primitems ("itemID", "primID", "assetID", "parentFolderID", "invType", "assetType", "name", "description", "creationDate", "creatorID", "ownerID", "lastOwnerID", "groupID", "nextPermissions", "currentPermissions", "basePermissions", "everyonePermissions", "groupPermissions", flags) | ||
669 | SELECT cast("itemID" as uuid), cast("primID" as uuid), cast("assetID" as uuid), cast("parentFolderID" as uuid), "invType", "assetType", "name", "description", "creationDate", cast("creatorID" as uuid), cast("ownerID" as uuid), cast("lastOwnerID" as uuid), cast("groupID" as uuid), "nextPermissions", "currentPermissions", "basePermissions", "everyonePermissions", "groupPermissions", flags | ||
670 | FROM primitems ; | ||
671 | |||
672 | DROP TABLE primitems; | ||
673 | |||
674 | alter table Tmp_primitems rename to primitems; | ||
675 | |||
676 | ALTER TABLE primitems ADD CONSTRAINT | ||
677 | PK__primitems__0A688BB1 PRIMARY KEY | ||
678 | ( | ||
679 | "itemID" | ||
680 | ); | ||
681 | |||
682 | CREATE INDEX primitems_primid ON primitems | ||
683 | ( | ||
684 | "primID" | ||
685 | ) ; | ||
686 | |||
687 | COMMIT; | ||
688 | |||
689 | |||
690 | :VERSION 16 | ||
691 | |||
692 | |||
693 | BEGIN TRANSACTION; | ||
694 | |||
695 | CREATE TABLE Tmp_terrain | ||
696 | ( | ||
697 | "RegionUUID" uuid NULL, | ||
698 | "Revision" int NULL, | ||
699 | "Heightfield" bytea NULL | ||
700 | ); | ||
701 | |||
702 | INSERT INTO Tmp_terrain ("RegionUUID", "Revision", "Heightfield") | ||
703 | SELECT cast("RegionUUID" as uuid), "Revision", "Heightfield" | ||
704 | FROM terrain ; | ||
705 | |||
706 | DROP TABLE terrain; | ||
707 | |||
708 | alter table Tmp_terrain rename to terrain; | ||
709 | |||
710 | COMMIT; | ||
711 | |||
712 | |||
713 | :VERSION 17 | ||
714 | |||
715 | BEGIN TRANSACTION; | ||
716 | |||
717 | CREATE TABLE Tmp_land | ||
718 | ( | ||
719 | "UUID" uuid NOT NULL, | ||
720 | "RegionUUID" uuid NULL, | ||
721 | "LocalLandID" int NULL, | ||
722 | "Bitmap" bytea NULL, | ||
723 | "Name" varchar(255) NULL, | ||
724 | "Description" varchar(255) NULL, | ||
725 | "OwnerUUID" uuid NULL, | ||
726 | "IsGroupOwned" boolean NULL, | ||
727 | "Area" int NULL, | ||
728 | "AuctionID" int NULL, | ||
729 | "Category" int NULL, | ||
730 | "ClaimDate" int NULL, | ||
731 | "ClaimPrice" int NULL, | ||
732 | "GroupUUID" uuid NULL, | ||
733 | "SalePrice" int NULL, | ||
734 | "LandStatus" int NULL, | ||
735 | "LandFlags" int NULL, | ||
736 | "LandingType" int NULL, | ||
737 | "MediaAutoScale" int NULL, | ||
738 | "MediaTextureUUID" uuid NULL, | ||
739 | "MediaURL" varchar(255) NULL, | ||
740 | "MusicURL" varchar(255) NULL, | ||
741 | "PassHours" double precision NULL, | ||
742 | "PassPrice" int NULL, | ||
743 | "SnapshotUUID" uuid NULL, | ||
744 | "UserLocationX" double precision NULL, | ||
745 | "UserLocationY" double precision NULL, | ||
746 | "UserLocationZ" double precision NULL, | ||
747 | "UserLookAtX" double precision NULL, | ||
748 | "UserLookAtY" double precision NULL, | ||
749 | "UserLookAtZ" double precision NULL, | ||
750 | "AuthbuyerID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), | ||
751 | "OtherCleanTime" int NOT NULL DEFAULT ((0)), | ||
752 | "Dwell" int NOT NULL DEFAULT ((0)) | ||
753 | ); | ||
754 | |||
755 | INSERT INTO Tmp_land ("UUID", "RegionUUID", "LocalLandID", "Bitmap", "Name", "Description", "OwnerUUID", "IsGroupOwned", "Area", "AuctionID", "Category", "ClaimDate", "ClaimPrice", "GroupUUID", "SalePrice", "LandStatus", "LandFlags", "LandingType", "MediaAutoScale", "MediaTextureUUID", "MediaURL", "MusicURL", "PassHours", "PassPrice", "SnapshotUUID", "UserLocationX", "UserLocationY", "UserLocationZ", "UserLookAtX", "UserLookAtY", "UserLookAtZ", "AuthbuyerID", "OtherCleanTime", "Dwell") | ||
756 | SELECT cast("UUID" as uuid), cast("RegionUUID" as uuid), "LocalLandID", "Bitmap", "Name", "Description", cast("OwnerUUID" as uuid), "IsGroupOwned", "Area", "AuctionID", "Category", "ClaimDate", "ClaimPrice", cast("GroupUUID" as uuid), "SalePrice", "LandStatus", "LandFlags", "LandingType", "MediaAutoScale", cast("MediaTextureUUID" as uuid), "MediaURL", "MusicURL", "PassHours", "PassPrice", cast("SnapshotUUID" as uuid), "UserLocationX", "UserLocationY", "UserLocationZ", "UserLookAtX", "UserLookAtY", "UserLookAtZ", cast("AuthbuyerID" as uuid), "OtherCleanTime", "Dwell" | ||
757 | FROM land ; | ||
758 | |||
759 | DROP TABLE land; | ||
760 | |||
761 | alter table Tmp_land rename to land; | ||
762 | |||
763 | ALTER TABLE land ADD CONSTRAINT | ||
764 | PK__land__65A475E71BFD2C07 PRIMARY KEY | ||
765 | ( | ||
766 | "UUID" | ||
767 | ); | ||
768 | |||
769 | Create index on land (lower("Name")); | ||
770 | |||
771 | COMMIT; | ||
772 | |||
773 | |||
774 | |||
775 | :VERSION 18 | ||
776 | |||
777 | BEGIN TRANSACTION; | ||
778 | |||
779 | CREATE TABLE Tmp_landaccesslist | ||
780 | ( | ||
781 | "LandUUID" uuid NULL, | ||
782 | "AccessUUID" uuid NULL, | ||
783 | "Flags" int NULL | ||
784 | ); | ||
785 | |||
786 | INSERT INTO Tmp_landaccesslist ("LandUUID", "AccessUUID", "Flags") | ||
787 | SELECT cast("LandUUID" as uuid), cast("AccessUUID" as uuid), "Flags" | ||
788 | FROM landaccesslist ; | ||
789 | |||
790 | DROP TABLE landaccesslist; | ||
791 | |||
792 | alter table Tmp_landaccesslist rename to landaccesslist; | ||
793 | |||
794 | COMMIT; | ||
795 | |||
796 | |||
797 | |||
798 | :VERSION 19 | ||
799 | |||
800 | BEGIN TRANSACTION; | ||
801 | |||
802 | CREATE TABLE Tmp_regionban | ||
803 | ( | ||
804 | "regionUUID" uuid NOT NULL, | ||
805 | "bannedUUID" uuid NOT NULL, | ||
806 | "bannedIp" varchar(16) NOT NULL, | ||
807 | "bannedIpHostMask" varchar(16) NOT NULL | ||
808 | ); | ||
809 | |||
810 | INSERT INTO Tmp_regionban ("regionUUID", "bannedUUID", "bannedIp", "bannedIpHostMask") | ||
811 | SELECT cast("regionUUID" as uuid), cast("bannedUUID" as uuid), "bannedIp", "bannedIpHostMask" | ||
812 | FROM regionban ; | ||
813 | |||
814 | DROP TABLE regionban; | ||
815 | |||
816 | alter table Tmp_regionban rename to regionban; | ||
817 | |||
818 | COMMIT; | ||
819 | |||
820 | |||
821 | :VERSION 20 | ||
822 | |||
823 | BEGIN TRANSACTION; | ||
824 | |||
825 | CREATE TABLE Tmp_regionsettings | ||
826 | ( | ||
827 | "regionUUID" uuid NOT NULL, | ||
828 | "block_terraform" boolean NOT NULL, | ||
829 | "block_fly" boolean NOT NULL, | ||
830 | "allow_damage" boolean NOT NULL, | ||
831 | "restrict_pushing" boolean NOT NULL, | ||
832 | "allow_land_resell" boolean NOT NULL, | ||
833 | "allow_land_join_divide" boolean NOT NULL, | ||
834 | "block_show_in_search" boolean NOT NULL, | ||
835 | "agent_limit" int NOT NULL, | ||
836 | "object_bonus" double precision NOT NULL, | ||
837 | "maturity" int NOT NULL, | ||
838 | "disable_scripts" boolean NOT NULL, | ||
839 | "disable_collisions" boolean NOT NULL, | ||
840 | "disable_physics" boolean NOT NULL, | ||
841 | "terrain_texture_1" uuid NOT NULL, | ||
842 | "terrain_texture_2" uuid NOT NULL, | ||
843 | "terrain_texture_3" uuid NOT NULL, | ||
844 | "terrain_texture_4" uuid NOT NULL, | ||
845 | "elevation_1_nw" double precision NOT NULL, | ||
846 | "elevation_2_nw" double precision NOT NULL, | ||
847 | "elevation_1_ne" double precision NOT NULL, | ||
848 | "elevation_2_ne" double precision NOT NULL, | ||
849 | "elevation_1_se" double precision NOT NULL, | ||
850 | "elevation_2_se" double precision NOT NULL, | ||
851 | "elevation_1_sw" double precision NOT NULL, | ||
852 | "elevation_2_sw" double precision NOT NULL, | ||
853 | "water_height" double precision NOT NULL, | ||
854 | "terrain_raise_limit" double precision NOT NULL, | ||
855 | "terrain_lower_limit" double precision NOT NULL, | ||
856 | "use_estate_sun" boolean NOT NULL, | ||
857 | "fixed_sun" boolean NOT NULL, | ||
858 | "sun_position" double precision NOT NULL, | ||
859 | "covenant" uuid NULL DEFAULT (NULL), | ||
860 | "Sandbox" boolean NOT NULL, | ||
861 | "sunvectorx" double precision NOT NULL DEFAULT ((0)), | ||
862 | "sunvectory" double precision NOT NULL DEFAULT ((0)), | ||
863 | "sunvectorz" double precision NOT NULL DEFAULT ((0)) | ||
864 | ); | ||
865 | |||
866 | INSERT INTO Tmp_regionsettings ("regionUUID", "block_terraform", "block_fly", "allow_damage", "restrict_pushing", "allow_land_resell", "allow_land_join_divide", "block_show_in_search", "agent_limit", "object_bonus", "maturity", "disable_scripts", "disable_collisions", "disable_physics", "terrain_texture_1", "terrain_texture_2", "terrain_texture_3", "terrain_texture_4", "elevation_1_nw", "elevation_2_nw", "elevation_1_ne", "elevation_2_ne", "elevation_1_se", "elevation_2_se", "elevation_1_sw", "elevation_2_sw", "water_height", "terrain_raise_limit", "terrain_lower_limit", "use_estate_sun", "fixed_sun", "sun_position", "covenant", "Sandbox", "sunvectorx", "sunvectory", "sunvectorz") | ||
867 | SELECT cast("regionUUID" as uuid), "block_terraform", "block_fly", "allow_damage", "restrict_pushing", "allow_land_resell", "allow_land_join_divide", "block_show_in_search", "agent_limit", "object_bonus", "maturity", "disable_scripts", "disable_collisions", "disable_physics", cast("terrain_texture_1" as uuid), cast("terrain_texture_2" as uuid), cast("terrain_texture_3" as uuid), cast("terrain_texture_4" as uuid), "elevation_1_nw", "elevation_2_nw", "elevation_1_ne", "elevation_2_ne", "elevation_1_se", "elevation_2_se", "elevation_1_sw", "elevation_2_sw", "water_height", "terrain_raise_limit", "terrain_lower_limit", "use_estate_sun", "fixed_sun", "sun_position", cast("covenant" as uuid), "Sandbox", "sunvectorx", "sunvectory", "sunvectorz" | ||
868 | FROM regionsettings ; | ||
869 | |||
870 | DROP TABLE regionsettings; | ||
871 | |||
872 | alter table Tmp_regionsettings rename to regionsettings; | ||
873 | |||
874 | ALTER TABLE regionsettings ADD CONSTRAINT | ||
875 | PK__regionse__5B35159D21B6055D PRIMARY KEY | ||
876 | ( | ||
877 | "regionUUID" | ||
878 | ); | ||
879 | |||
880 | COMMIT; | ||
881 | |||
882 | |||
883 | :VERSION 21 | ||
884 | |||
885 | BEGIN TRANSACTION; | ||
886 | |||
887 | ALTER TABLE prims ADD "PassTouches" boolean not null default false; | ||
888 | |||
889 | COMMIT; | ||
890 | |||
891 | |||
892 | :VERSION 22 | ||
893 | |||
894 | BEGIN TRANSACTION; | ||
895 | |||
896 | ALTER TABLE regionsettings ADD "loaded_creation_date" varchar(20) ; | ||
897 | ALTER TABLE regionsettings ADD "loaded_creation_time" varchar(20) ; | ||
898 | ALTER TABLE regionsettings ADD "loaded_creation_id" varchar(64) ; | ||
899 | |||
900 | COMMIT; | ||
901 | |||
902 | :VERSION 23 | ||
903 | |||
904 | BEGIN TRANSACTION; | ||
905 | |||
906 | ALTER TABLE regionsettings DROP COLUMN "loaded_creation_date"; | ||
907 | ALTER TABLE regionsettings DROP COLUMN "loaded_creation_time"; | ||
908 | ALTER TABLE regionsettings ADD "loaded_creation_datetime" int NOT NULL default 0; | ||
909 | |||
910 | COMMIT; | ||
911 | |||
912 | :VERSION 24 | ||
913 | |||
914 | BEGIN TRANSACTION; | ||
915 | |||
916 | ALTER TABLE prims ADD "MediaURL" varchar(255); | ||
917 | ALTER TABLE primshapes ADD "Media" TEXT NULL; | ||
918 | |||
919 | COMMIT; | ||
920 | |||
921 | :VERSION 25 | ||
922 | |||
923 | BEGIN TRANSACTION; | ||
924 | CREATE TABLE regionwindlight ( | ||
925 | "region_id" varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000' PRIMARY KEY, | ||
926 | "water_color_r" double precision NOT NULL DEFAULT '4.000000', | ||
927 | water_color_g double precision NOT NULL DEFAULT '38.000000', | ||
928 | water_color_b double precision NOT NULL DEFAULT '64.000000', | ||
929 | water_fog_density_exponent double precision NOT NULL DEFAULT '4.0', | ||
930 | underwater_fog_modifier double precision NOT NULL DEFAULT '0.25', | ||
931 | reflection_wavelet_scale_1 double precision NOT NULL DEFAULT '2.0', | ||
932 | reflection_wavelet_scale_2 double precision NOT NULL DEFAULT '2.0', | ||
933 | reflection_wavelet_scale_3 double precision NOT NULL DEFAULT '2.0', | ||
934 | fresnel_scale double precision NOT NULL DEFAULT '0.40', | ||
935 | fresnel_offset double precision NOT NULL DEFAULT '0.50', | ||
936 | refract_scale_above double precision NOT NULL DEFAULT '0.03', | ||
937 | refract_scale_below double precision NOT NULL DEFAULT '0.20', | ||
938 | blur_multiplier double precision NOT NULL DEFAULT '0.040', | ||
939 | big_wave_direction_x double precision NOT NULL DEFAULT '1.05', | ||
940 | big_wave_direction_y double precision NOT NULL DEFAULT '-0.42', | ||
941 | little_wave_direction_x double precision NOT NULL DEFAULT '1.11', | ||
942 | little_wave_direction_y double precision NOT NULL DEFAULT '-1.16', | ||
943 | normal_map_texture varchar(36) NOT NULL DEFAULT '822ded49-9a6c-f61c-cb89-6df54f42cdf4', | ||
944 | horizon_r double precision NOT NULL DEFAULT '0.25', | ||
945 | horizon_g double precision NOT NULL DEFAULT '0.25', | ||
946 | horizon_b double precision NOT NULL DEFAULT '0.32', | ||
947 | horizon_i double precision NOT NULL DEFAULT '0.32', | ||
948 | haze_horizon double precision NOT NULL DEFAULT '0.19', | ||
949 | blue_density_r double precision NOT NULL DEFAULT '0.12', | ||
950 | blue_density_g double precision NOT NULL DEFAULT '0.22', | ||
951 | blue_density_b double precision NOT NULL DEFAULT '0.38', | ||
952 | blue_density_i double precision NOT NULL DEFAULT '0.38', | ||
953 | haze_density double precision NOT NULL DEFAULT '0.70', | ||
954 | density_multiplier double precision NOT NULL DEFAULT '0.18', | ||
955 | distance_multiplier double precision NOT NULL DEFAULT '0.8', | ||
956 | max_altitude int NOT NULL DEFAULT '1605', | ||
957 | sun_moon_color_r double precision NOT NULL DEFAULT '0.24', | ||
958 | sun_moon_color_g double precision NOT NULL DEFAULT '0.26', | ||
959 | sun_moon_color_b double precision NOT NULL DEFAULT '0.30', | ||
960 | sun_moon_color_i double precision NOT NULL DEFAULT '0.30', | ||
961 | sun_moon_position double precision NOT NULL DEFAULT '0.317', | ||
962 | ambient_r double precision NOT NULL DEFAULT '0.35', | ||
963 | ambient_g double precision NOT NULL DEFAULT '0.35', | ||
964 | ambient_b double precision NOT NULL DEFAULT '0.35', | ||
965 | ambient_i double precision NOT NULL DEFAULT '0.35', | ||
966 | east_angle double precision NOT NULL DEFAULT '0.00', | ||
967 | sun_glow_focus double precision NOT NULL DEFAULT '0.10', | ||
968 | sun_glow_size double precision NOT NULL DEFAULT '1.75', | ||
969 | scene_gamma double precision NOT NULL DEFAULT '1.00', | ||
970 | star_brightness double precision NOT NULL DEFAULT '0.00', | ||
971 | cloud_color_r double precision NOT NULL DEFAULT '0.41', | ||
972 | cloud_color_g double precision NOT NULL DEFAULT '0.41', | ||
973 | cloud_color_b double precision NOT NULL DEFAULT '0.41', | ||
974 | cloud_color_i double precision NOT NULL DEFAULT '0.41', | ||
975 | cloud_x double precision NOT NULL DEFAULT '1.00', | ||
976 | cloud_y double precision NOT NULL DEFAULT '0.53', | ||
977 | cloud_density double precision NOT NULL DEFAULT '1.00', | ||
978 | cloud_coverage double precision NOT NULL DEFAULT '0.27', | ||
979 | cloud_scale double precision NOT NULL DEFAULT '0.42', | ||
980 | cloud_detail_x double precision NOT NULL DEFAULT '1.00', | ||
981 | cloud_detail_y double precision NOT NULL DEFAULT '0.53', | ||
982 | cloud_detail_density double precision NOT NULL DEFAULT '0.12', | ||
983 | cloud_scroll_x double precision NOT NULL DEFAULT '0.20', | ||
984 | cloud_scroll_x_lock smallint NOT NULL DEFAULT '0', | ||
985 | cloud_scroll_y double precision NOT NULL DEFAULT '0.01', | ||
986 | cloud_scroll_y_lock smallint NOT NULL DEFAULT '0', | ||
987 | draw_classic_clouds smallint NOT NULL DEFAULT '1' | ||
988 | ); | ||
989 | |||
990 | COMMIT; | ||
991 | |||
992 | :VERSION 26 | ||
993 | |||
994 | BEGIN TRANSACTION; | ||
995 | |||
996 | ALTER TABLE regionsettings ADD "map_tile_ID" CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; | ||
997 | |||
998 | COMMIT; | ||
999 | |||
1000 | :VERSION 27 #--------------------- | ||
1001 | |||
1002 | BEGIN TRANSACTION; | ||
1003 | ALTER TABLE land ADD "MediaType" VARCHAR(32) NOT NULL DEFAULT 'none/none' ; | ||
1004 | ALTER TABLE land ADD "MediaDescription" VARCHAR(255) NOT NULL DEFAULT ''; | ||
1005 | ALTER TABLE land ADD "MediaSize" VARCHAR(16) NOT NULL DEFAULT '0,0'; | ||
1006 | ALTER TABLE land ADD "MediaLoop" boolean NOT NULL DEFAULT false; | ||
1007 | ALTER TABLE land ADD "ObscureMusic" boolean NOT NULL DEFAULT false; | ||
1008 | ALTER TABLE land ADD "ObscureMedia" boolean NOT NULL DEFAULT false; | ||
1009 | COMMIT; | ||
1010 | |||
1011 | :VERSION 28 #--------------------- | ||
1012 | |||
1013 | BEGIN TRANSACTION; | ||
1014 | |||
1015 | ALTER TABLE prims | ||
1016 | alter column "CreatorID" set DEFAULT '00000000-0000-0000-0000-000000000000' ; | ||
1017 | |||
1018 | ALTER TABLE prims ALTER COLUMN "CreatorID" set NOT NULL; | ||
1019 | |||
1020 | ALTER TABLE primitems | ||
1021 | alter column "creatorID" set DEFAULT '00000000-0000-0000-0000-000000000000' ; | ||
1022 | |||
1023 | ALTER TABLE primitems ALTER COLUMN "creatorID" set NOT NULL; | ||
1024 | |||
1025 | COMMIT; | ||
1026 | |||
1027 | :VERSION 29 #----------------- Region Covenant changed time | ||
1028 | |||
1029 | BEGIN TRANSACTION; | ||
1030 | |||
1031 | ALTER TABLE regionsettings ADD "covenant_datetime" int NOT NULL default 0; | ||
1032 | |||
1033 | COMMIT; | ||
1034 | |||
1035 | :VERSION 30 #------------------Migrate "creatorID" storage to varchars instead of UUIDs for HG support | ||
1036 | |||
1037 | BEGIN TRANSACTION; | ||
1038 | |||
1039 | alter table prims rename column "CreatorID" to "CreatorIDOld"; | ||
1040 | alter table primitems rename column "creatorID" to "creatorIDOld"; | ||
1041 | |||
1042 | COMMIT; | ||
1043 | |||
1044 | :VERSION 31 #--------------------- | ||
1045 | |||
1046 | BEGIN TRANSACTION; | ||
1047 | |||
1048 | ALTER TABLE prims ADD "CreatorID" varchar(255); | ||
1049 | ALTER TABLE primitems ADD "creatorID" varchar(255); | ||
1050 | |||
1051 | COMMIT; | ||
1052 | |||
1053 | :VERSION 32 #--------------------- | ||
1054 | |||
1055 | BEGIN TRANSACTION; | ||
1056 | |||
1057 | UPDATE prims SET "CreatorID" = cast("CreatorIDOld" as varchar(255)); | ||
1058 | UPDATE primitems SET "creatorID" = cast("creatorIDOld" as varchar(255)); | ||
1059 | |||
1060 | COMMIT; | ||
1061 | |||
1062 | :VERSION 33 #--------------------- | ||
1063 | |||
1064 | BEGIN TRANSACTION; | ||
1065 | |||
1066 | ALTER TABLE prims alter column "CreatorID" set default '00000000-0000-0000-0000-000000000000' ; | ||
1067 | |||
1068 | ALTER TABLE prims ALTER COLUMN "CreatorID" set NOT NULL; | ||
1069 | |||
1070 | ALTER TABLE primitems alter column "creatorID" set DEFAULT '00000000-0000-0000-0000-000000000000' ; | ||
1071 | |||
1072 | ALTER TABLE primitems ALTER COLUMN "creatorID" set NOT NULL; | ||
1073 | |||
1074 | COMMIT; | ||
1075 | |||
1076 | :VERSION 34 #--------------- Telehub support | ||
1077 | |||
1078 | BEGIN TRANSACTION; | ||
1079 | |||
1080 | CREATE TABLE spawn_points( | ||
1081 | "RegionUUID" uuid NOT NULL PRIMARY KEY, | ||
1082 | "Yaw" double precision NOT NULL, | ||
1083 | "Pitch" double precision NOT NULL, | ||
1084 | "Distance" double precision NOT NULL | ||
1085 | ); | ||
1086 | |||
1087 | ALTER TABLE regionsettings ADD "TelehubObject" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; | ||
1088 | |||
1089 | COMMIT; | ||
1090 | |||
1091 | :VERSION 35 #---------------- Parcels for sale | ||
1092 | |||
1093 | BEGIN TRANSACTION; | ||
1094 | |||
1095 | ALTER TABLE regionsettings ADD "parcel_tile_ID" uuid NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; | ||
1096 | |||
1097 | COMMIT; | ||
1098 | |||
1099 | :VERSION 36 #---------------- Timed bans/access | ||
1100 | |||
1101 | BEGIN TRANSACTION; | ||
1102 | |||
1103 | ALTER TABLE landaccesslist ADD "Expires" integer NOT NULL DEFAULT 0; | ||
1104 | |||
1105 | COMMIT; | ||
1106 | |||
1107 | :VERSION 37 #---------------- Environment Settings | ||
1108 | |||
1109 | BEGIN TRANSACTION; | ||
1110 | |||
1111 | CREATE TABLE regionenvironment( | ||
1112 | "region_id" uuid NOT NULL primary key, | ||
1113 | "llsd_settings" varchar NOT NULL | ||
1114 | ); | ||
1115 | |||
1116 | COMMIT; | ||
1117 | |||
1118 | :VERSION 38 #---------------- Dynamic attributes | ||
1119 | |||
1120 | BEGIN TRANSACTION; | ||
1121 | |||
1122 | ALTER TABLE prims ADD "DynAttrs" TEXT; | ||
1123 | |||
1124 | COMMIT; | ||
1125 | |||
1126 | :VERSION 39 #---------------- Extra physics params | ||
1127 | |||
1128 | BEGIN TRANSACTION; | ||
1129 | |||
1130 | ALTER TABLE prims ADD "PhysicsShapeType" smallint NOT NULL default '0'; | ||
1131 | ALTER TABLE prims ADD "Density" double precision NOT NULL default '1000'; | ||
1132 | ALTER TABLE prims ADD "GravityModifier" double precision NOT NULL default '1'; | ||
1133 | ALTER TABLE prims ADD "Friction" double precision NOT NULL default '0.6'; | ||
1134 | ALTER TABLE prims ADD "Restitution" double precision NOT NULL default '0.5'; | ||
1135 | |||
1136 | COMMIT; | ||
1137 | |||
1138 | :VERSION 40 #-- regionwindlight changed type from smallint to bool | ||
1139 | |||
1140 | BEGIN TRANSACTION; | ||
1141 | |||
1142 | ALTER TABLE regionwindlight ALTER COLUMN cloud_scroll_x_lock DROP DEFAULT; | ||
1143 | ALTER TABLE regionwindlight ALTER cloud_scroll_x_lock TYPE bool USING CASE WHEN cloud_scroll_x_lock=0 THEN FALSE ELSE TRUE END; | ||
1144 | ALTER TABLE regionwindlight ALTER COLUMN cloud_scroll_x_lock SET DEFAULT FALSE; | ||
1145 | |||
1146 | ALTER TABLE regionwindlight ALTER COLUMN cloud_scroll_y_lock DROP DEFAULT; | ||
1147 | ALTER TABLE regionwindlight ALTER cloud_scroll_y_lock TYPE bool USING CASE WHEN cloud_scroll_y_lock=0 THEN FALSE ELSE TRUE END; | ||
1148 | ALTER TABLE regionwindlight ALTER COLUMN cloud_scroll_y_lock SET DEFAULT FALSE; | ||
1149 | |||
1150 | ALTER TABLE regionwindlight ALTER COLUMN draw_classic_clouds DROP DEFAULT; | ||
1151 | ALTER TABLE regionwindlight ALTER draw_classic_clouds TYPE bool USING CASE WHEN draw_classic_clouds=0 THEN FALSE ELSE TRUE END; | ||
1152 | ALTER TABLE regionwindlight ALTER COLUMN draw_classic_clouds SET DEFAULT FALSE; | ||
1153 | |||
1154 | COMMIT; | ||
1155 | |||
1156 | VERSION 41 #-- Change Landlags to bigint | ||
1157 | |||
1158 | BEGIN TRANSACTION; | ||
1159 | |||
1160 | ALTER TABLE land ALTER "LandFlags" TYPE bigint; | ||
1161 | |||
1162 | COMMIT; | ||
diff --git a/OpenSim/Data/PGSQL/Resources/UserAccount.migrations b/OpenSim/Data/PGSQL/Resources/UserAccount.migrations new file mode 100644 index 0000000..c785463 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/UserAccount.migrations | |||
@@ -0,0 +1,51 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | CREATE TABLE UserAccounts ( | ||
4 | "PrincipalID" uuid NOT NULL Primary key, | ||
5 | "ScopeID" uuid NOT NULL, | ||
6 | "FirstName" varchar(64) NOT NULL, | ||
7 | "LastName" varchar(64) NOT NULL, | ||
8 | "Email" varchar(64) NULL, | ||
9 | "ServiceURLs" text NULL, | ||
10 | "Created" int default NULL | ||
11 | ); | ||
12 | |||
13 | |||
14 | :VERSION 2 | ||
15 | |||
16 | BEGIN TRANSACTION; | ||
17 | |||
18 | INSERT INTO UserAccounts ("PrincipalID", "ScopeID", "FirstName", "LastName", "Email", "ServiceURLs", "Created") | ||
19 | SELECT UUID AS "PrincipalID", '00000000-0000-0000-0000-000000000000' AS "ScopeID", | ||
20 | username AS "FirstName", | ||
21 | lastname AS "LastName", | ||
22 | email as "Email", ( | ||
23 | 'AssetServerURI=' + | ||
24 | userAssetURI + ' InventoryServerURI=' + userInventoryURI + ' GatewayURI= HomeURI=') AS "ServiceURLs", | ||
25 | created as "Created" FROM users; | ||
26 | |||
27 | COMMIT; | ||
28 | |||
29 | :VERSION 3 | ||
30 | |||
31 | BEGIN TRANSACTION; | ||
32 | |||
33 | CREATE UNIQUE INDEX "PrincipalID" ON UserAccounts("PrincipalID"); | ||
34 | CREATE INDEX "Email" ON UserAccounts("Email"); | ||
35 | CREATE INDEX "FirstName" ON UserAccounts("FirstName"); | ||
36 | CREATE INDEX "LastName" ON UserAccounts("LastName"); | ||
37 | CREATE INDEX Name ON UserAccounts("FirstName","LastName"); | ||
38 | |||
39 | COMMIT; | ||
40 | |||
41 | :VERSION 4 | ||
42 | |||
43 | BEGIN TRANSACTION; | ||
44 | |||
45 | ALTER TABLE UserAccounts ADD "UserLevel" integer NOT NULL DEFAULT 0; | ||
46 | ALTER TABLE UserAccounts ADD "UserFlags" integer NOT NULL DEFAULT 0; | ||
47 | ALTER TABLE UserAccounts ADD "UserTitle" varchar(64) NOT NULL DEFAULT ''; | ||
48 | |||
49 | COMMIT; | ||
50 | |||
51 | |||
diff --git a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations new file mode 100644 index 0000000..a6bd8ca --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations | |||
@@ -0,0 +1,155 @@ | |||
1 | :VERSION 1 # ------------------------------- | ||
2 | |||
3 | begin; | ||
4 | |||
5 | CREATE TABLE classifieds ( | ||
6 | "classifieduuid" char(36) NOT NULL, | ||
7 | "creatoruuid" char(36) NOT NULL, | ||
8 | "creationdate" integer NOT NULL, | ||
9 | "expirationdate" integer NOT NULL, | ||
10 | "category" varchar(20) NOT NULL, | ||
11 | "name" varchar(255) NOT NULL, | ||
12 | "description" text NOT NULL, | ||
13 | "parceluuid" char(36) NOT NULL, | ||
14 | "parentestate" integer NOT NULL, | ||
15 | "snapshotuuid" char(36) NOT NULL, | ||
16 | "simname" varchar(255) NOT NULL, | ||
17 | "posglobal" varchar(255) NOT NULL, | ||
18 | "parcelname" varchar(255) NOT NULL, | ||
19 | "classifiedflags" integer NOT NULL, | ||
20 | "priceforlisting" integer NOT NULL, | ||
21 | constraint classifiedspk PRIMARY KEY ("classifieduuid") | ||
22 | ); | ||
23 | |||
24 | |||
25 | CREATE TABLE usernotes ( | ||
26 | "useruuid" varchar(36) NOT NULL, | ||
27 | "targetuuid" varchar(36) NOT NULL, | ||
28 | "notes" text NOT NULL, | ||
29 | constraint usernoteuk UNIQUE ("useruuid","targetuuid") | ||
30 | ); | ||
31 | |||
32 | |||
33 | CREATE TABLE userpicks ( | ||
34 | "pickuuid" varchar(36) NOT NULL, | ||
35 | "creatoruuid" varchar(36) NOT NULL, | ||
36 | "toppick" boolean NOT NULL, | ||
37 | "parceluuid" varchar(36) NOT NULL, | ||
38 | "name" varchar(255) NOT NULL, | ||
39 | "description" text NOT NULL, | ||
40 | "snapshotuuid" varchar(36) NOT NULL, | ||
41 | "user" varchar(255) NOT NULL, | ||
42 | "originalname" varchar(255) NOT NULL, | ||
43 | "simname" varchar(255) NOT NULL, | ||
44 | "posglobal" varchar(255) NOT NULL, | ||
45 | "sortorder" integer NOT NULL, | ||
46 | "enabled" boolean NOT NULL, | ||
47 | PRIMARY KEY ("pickuuid") | ||
48 | ); | ||
49 | |||
50 | |||
51 | CREATE TABLE userprofile ( | ||
52 | "useruuid" varchar(36) NOT NULL, | ||
53 | "profilePartner" varchar(36) NOT NULL, | ||
54 | "profileAllowPublish" bytea NOT NULL, | ||
55 | "profileMaturePublish" bytea NOT NULL, | ||
56 | "profileURL" varchar(255) NOT NULL, | ||
57 | "profileWantToMask" integer NOT NULL, | ||
58 | "profileWantToText" text NOT NULL, | ||
59 | "profileSkillsMask" integer NOT NULL, | ||
60 | "profileSkillsText" text NOT NULL, | ||
61 | "profileLanguages" text NOT NULL, | ||
62 | "profileImage" varchar(36) NOT NULL, | ||
63 | "profileAboutText" text NOT NULL, | ||
64 | "profileFirstImage" varchar(36) NOT NULL, | ||
65 | "profileFirstText" text NOT NULL, | ||
66 | PRIMARY KEY ("useruuid") | ||
67 | ); | ||
68 | |||
69 | commit; | ||
70 | |||
71 | :VERSION 2 # ------------------------------- | ||
72 | |||
73 | begin; | ||
74 | CREATE TABLE userdata ( | ||
75 | "UserId" char(36) NOT NULL, | ||
76 | "TagId" varchar(64) NOT NULL, | ||
77 | "DataKey" varchar(255), | ||
78 | "DataVal" varchar(255), | ||
79 | PRIMARY KEY ("UserId","TagId") | ||
80 | ); | ||
81 | |||
82 | commit; | ||
83 | |||
84 | :VERSION 3 # ------------------------------- | ||
85 | begin; | ||
86 | CREATE TABLE usersettings ( | ||
87 | "useruuid" char(36) NOT NULL, | ||
88 | "imviaemail" bytea NOT NULL, | ||
89 | "visible" bytea NOT NULL, | ||
90 | PRIMARY KEY ("useruuid") | ||
91 | ); | ||
92 | commit; | ||
93 | |||
94 | :VERSION 4 | ||
95 | |||
96 | BEGIN; | ||
97 | |||
98 | -- Classifieds | ||
99 | ALTER TABLE classifieds DROP CONSTRAINT classifiedspk; | ||
100 | ALTER TABLE classifieds ALTER COLUMN classifieduuid SET DATA TYPE uuid using classifieduuid::uuid; | ||
101 | ALTER TABLE classifieds ALTER COLUMN creatoruuid SET DATA TYPE uuid using creatoruuid::uuid; | ||
102 | ALTER TABLE classifieds ALTER COLUMN parceluuid SET DATA TYPE uuid using parceluuid::uuid; | ||
103 | ALTER TABLE classifieds ALTER COLUMN snapshotuuid SET DATA TYPE uuid using snapshotuuid::uuid; | ||
104 | ALTER TABLE classifieds ADD CONSTRAINT classifiedspk PRIMARY KEY (classifieduuid); | ||
105 | |||
106 | -- Notes | ||
107 | ALTER TABLE usernotes DROP CONSTRAINT usernoteuk; | ||
108 | ALTER TABLE usernotes ALTER COLUMN useruuid SET DATA TYPE uuid USING useruuid::uuid; | ||
109 | ALTER TABLE usernotes ALTER COLUMN targetuuid SET DATA TYPE uuid USING targetuuid::uuid; | ||
110 | ALTER TABLE usernotes ADD CONSTRAINT usernoteuk UNIQUE (useruuid,targetuuid); | ||
111 | |||
112 | |||
113 | -- Userpicks | ||
114 | ALTER TABLE userpicks DROP CONSTRAINT userpicks_pkey; | ||
115 | ALTER TABLE userpicks ALTER COLUMN pickuuid SET DATA TYPE uuid USING pickuuid::uuid; | ||
116 | ALTER TABLE userpicks ALTER COLUMN creatoruuid SET DATA TYPE uuid USING creatoruuid::uuid; | ||
117 | ALTER TABLE userpicks ALTER COLUMN parceluuid SET DATA TYPE uuid USING parceluuid::uuid; | ||
118 | ALTER TABLE userpicks ALTER COLUMN parceluuid SET DATA TYPE uuid USING parceluuid::uuid; | ||
119 | ALTER TABLE userpicks ADD PRIMARY KEY (pickuuid); | ||
120 | |||
121 | -- Userprofile | ||
122 | ALTER TABLE userprofile DROP CONSTRAINT userprofile_pkey; | ||
123 | ALTER TABLE userprofile ALTER COLUMN useruuid SET DATA TYPE uuid USING useruuid::uuid; | ||
124 | ALTER TABLE userprofile ALTER COLUMN "profilePartner" SET DATA TYPE uuid USING "profilePartner"::uuid; | ||
125 | -- Force column conversions | ||
126 | ALTER TABLE userprofile ALTER COLUMN "profileAllowPublish" SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END; | ||
127 | ALTER TABLE userprofile ALTER COLUMN "profileMaturePublish" SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END; | ||
128 | ALTER TABLE userprofile ALTER COLUMN "profileImage" SET DATA TYPE uuid USING "profileImage"::uuid; | ||
129 | ALTER TABLE userprofile ALTER COLUMN "profileFirstImage" SET DATA TYPE uuid USING "profileFirstImage"::uuid; | ||
130 | ALTER TABLE userprofile ADD PRIMARY KEY (useruuid); | ||
131 | |||
132 | -- Userdata | ||
133 | ALTER TABLE userdata DROP CONSTRAINT userdata_pkey; | ||
134 | ALTER TABLE userdata ALTER COLUMN "UserId" SET DATA TYPE uuid USING "UserId"::uuid; | ||
135 | ALTER TABLE userdata ALTER COLUMN "UserId" SET DATA TYPE uuid USING "UserId"::uuid; | ||
136 | ALTER TABLE userdata ADD PRIMARY KEY ("UserId","TagId"); | ||
137 | |||
138 | |||
139 | -- Usersettings | ||
140 | ALTER TABLE usersettings DROP CONSTRAINT usersettings_pkey; | ||
141 | ALTER TABLE usersettings ALTER COLUMN useruuid SET DATA TYPE uuid USING useruuid::uuid; | ||
142 | ALTER TABLE usersettings ALTER COLUMN visible SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END; | ||
143 | ALTER TABLE usersettings ADD COLUMN email varchar(254) NOT NULL; | ||
144 | ALTER TABLE usersettings ADD PRIMARY KEY (useruuid); | ||
145 | |||
146 | COMMIT; | ||
147 | |||
148 | |||
149 | :VERSION 5 # ------------------------------- | ||
150 | |||
151 | BEGIN; | ||
152 | |||
153 | ALTER TABLE usersettings ALTER COLUMN imviaemail SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END; | ||
154 | |||
155 | COMMIT; \ No newline at end of file | ||
diff --git a/OpenSim/Data/PGSQL/Resources/UserStore.migrations b/OpenSim/Data/PGSQL/Resources/UserStore.migrations new file mode 100644 index 0000000..974d489 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/UserStore.migrations | |||
@@ -0,0 +1,404 @@ | |||
1 | :VERSION 1 | ||
2 | |||
3 | CREATE TABLE users ( | ||
4 | "UUID" varchar(36) NOT NULL default '' Primary Key, | ||
5 | "username" varchar(32) NOT NULL, | ||
6 | "lastname" varchar(32) NOT NULL, | ||
7 | "passwordHash" varchar(32) NOT NULL, | ||
8 | "passwordSalt" varchar(32) NOT NULL, | ||
9 | "homeRegion" bigint default NULL, | ||
10 | "homeLocationX" double precision default NULL, | ||
11 | "homeLocationY" double precision default NULL, | ||
12 | "homeLocationZ" double precision default NULL, | ||
13 | "homeLookAtX" double precision default NULL, | ||
14 | "homeLookAtY" double precision default NULL, | ||
15 | "homeLookAtZ" double precision default NULL, | ||
16 | "created" int NOT NULL, | ||
17 | "lastLogin" int NOT NULL, | ||
18 | "userInventoryURI" varchar(255) default NULL, | ||
19 | "userAssetURI" varchar(255) default NULL, | ||
20 | "profileCanDoMask" int default NULL, | ||
21 | "profileWantDoMask" int default NULL, | ||
22 | "profileAboutText" text, | ||
23 | "profileFirstText" text, | ||
24 | "profileImage" varchar(36) default NULL, | ||
25 | "profileFirstImage" varchar(36) default NULL, | ||
26 | "webLoginKey" varchar(36) default NULL | ||
27 | ); | ||
28 | |||
29 | CREATE INDEX "usernames" ON users | ||
30 | ( | ||
31 | "username" ASC, | ||
32 | "lastname" ASC | ||
33 | ); | ||
34 | |||
35 | |||
36 | CREATE TABLE agents ( | ||
37 | "UUID" varchar(36) NOT NULL Primary Key, | ||
38 | "sessionID" varchar(36) NOT NULL, | ||
39 | "secureSessionID" varchar(36) NOT NULL, | ||
40 | "agentIP" varchar(16) NOT NULL, | ||
41 | "agentPort" int NOT NULL, | ||
42 | "agentOnline" smallint NOT NULL, | ||
43 | "loginTime" int NOT NULL, | ||
44 | "logoutTime" int NOT NULL, | ||
45 | "currentRegion" varchar(36) NOT NULL, | ||
46 | "currentHandle" bigint NOT NULL, | ||
47 | "currentPos" varchar(64) NOT NULL | ||
48 | ); | ||
49 | |||
50 | CREATE INDEX session ON agents | ||
51 | ( | ||
52 | "sessionID" ASC | ||
53 | ); | ||
54 | |||
55 | CREATE INDEX ssession ON agents | ||
56 | ( | ||
57 | "secureSessionID" ASC | ||
58 | ); | ||
59 | |||
60 | |||
61 | CREATE TABLE userfriends( | ||
62 | "ownerID" varchar(50) NOT NULL, | ||
63 | "friendID" varchar(50) NOT NULL, | ||
64 | "friendPerms" varchar(50) NOT NULL, | ||
65 | "datetimestamp" varchar(50) NOT NULL | ||
66 | ); | ||
67 | |||
68 | CREATE TABLE avatarappearance ( | ||
69 | "Owner" varchar(36) NOT NULL primary key, | ||
70 | "Serial" int NOT NULL, | ||
71 | "Visual_Params" bytea NOT NULL, | ||
72 | "Texture" bytea NOT NULL, | ||
73 | "Avatar_Height" double precision NOT NULL, | ||
74 | "Body_Item" varchar(36) NOT NULL, | ||
75 | "Body_Asset" varchar(36) NOT NULL, | ||
76 | "Skin_Item" varchar(36) NOT NULL, | ||
77 | "Skin_Asset" varchar(36) NOT NULL, | ||
78 | "Hair_Item" varchar(36) NOT NULL, | ||
79 | "Hair_Asset" varchar(36) NOT NULL, | ||
80 | "Eyes_Item" varchar(36) NOT NULL, | ||
81 | "Eyes_Asset" varchar(36) NOT NULL, | ||
82 | "Shirt_Item" varchar(36) NOT NULL, | ||
83 | "Shirt_Asset" varchar(36) NOT NULL, | ||
84 | "Pants_Item" varchar(36) NOT NULL, | ||
85 | "Pants_Asset" varchar(36) NOT NULL, | ||
86 | "Shoes_Item" varchar(36) NOT NULL, | ||
87 | "Shoes_Asset" varchar(36) NOT NULL, | ||
88 | "Socks_Item" varchar(36) NOT NULL, | ||
89 | "Socks_Asset" varchar(36) NOT NULL, | ||
90 | "Jacket_Item" varchar(36) NOT NULL, | ||
91 | "Jacket_Asset" varchar(36) NOT NULL, | ||
92 | "Gloves_Item" varchar(36) NOT NULL, | ||
93 | "Gloves_Asset" varchar(36) NOT NULL, | ||
94 | "Undershirt_Item" varchar(36) NOT NULL, | ||
95 | "Undershirt_Asset" varchar(36) NOT NULL, | ||
96 | "Underpants_Item" varchar(36) NOT NULL, | ||
97 | "Underpants_Asset" varchar(36) NOT NULL, | ||
98 | "Skirt_Item" varchar(36) NOT NULL, | ||
99 | "Skirt_Asset" varchar(36) NOT NULL | ||
100 | ); | ||
101 | |||
102 | :VERSION 2 | ||
103 | |||
104 | BEGIN TRANSACTION; | ||
105 | |||
106 | ALTER TABLE users ADD "homeRegionID" varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000'; | ||
107 | ALTER TABLE users ADD "userFlags" int NOT NULL default 0; | ||
108 | ALTER TABLE users ADD "godLevel" int NOT NULL default 0; | ||
109 | ALTER TABLE users ADD "customType" varchar(32) not null default ''; | ||
110 | ALTER TABLE users ADD "partner" varchar(36) not null default '00000000-0000-0000-0000-000000000000'; | ||
111 | |||
112 | COMMIT; | ||
113 | |||
114 | |||
115 | :VERSION 3 | ||
116 | |||
117 | BEGIN TRANSACTION; | ||
118 | |||
119 | CREATE TABLE avatarattachments ( | ||
120 | "UUID" varchar(36) NOT NULL | ||
121 | , "attachpoint" int NOT NULL | ||
122 | , item varchar(36) NOT NULL | ||
123 | , asset varchar(36) NOT NULL); | ||
124 | |||
125 | CREATE INDEX IX_avatarattachments ON avatarattachments | ||
126 | ( | ||
127 | "UUID" | ||
128 | ); | ||
129 | |||
130 | COMMIT; | ||
131 | |||
132 | |||
133 | :VERSION 4 | ||
134 | |||
135 | BEGIN TRANSACTION; | ||
136 | |||
137 | CREATE TABLE Tmp_userfriends | ||
138 | ( | ||
139 | "ownerID" varchar(36) NOT NULL, | ||
140 | "friendID" varchar(36) NOT NULL, | ||
141 | "friendPerms" int NOT NULL, | ||
142 | "datetimestamp" int NOT NULL | ||
143 | ); | ||
144 | |||
145 | INSERT INTO Tmp_userfriends ("ownerID", "friendID", "friendPerms", "datetimestamp") | ||
146 | SELECT cast("ownerID" as varchar(36)), cast("friendID" as varchar(36)), cast("friendPerms" as int), cast("datetimestamp" as int) | ||
147 | FROM userfriends; | ||
148 | |||
149 | DROP TABLE userfriends; | ||
150 | |||
151 | alter table Tmp_userfriends rename to userfriends; | ||
152 | |||
153 | CREATE INDEX IX_userfriends_ownerID ON userfriends | ||
154 | ( | ||
155 | "ownerID" | ||
156 | ); | ||
157 | |||
158 | CREATE INDEX IX_userfriends_friendID ON userfriends | ||
159 | ( | ||
160 | "friendID" | ||
161 | ); | ||
162 | |||
163 | COMMIT; | ||
164 | |||
165 | |||
166 | :VERSION 5 | ||
167 | |||
168 | BEGIN TRANSACTION; | ||
169 | |||
170 | ALTER TABLE users add "email" varchar(250); | ||
171 | |||
172 | COMMIT; | ||
173 | |||
174 | |||
175 | :VERSION 6 | ||
176 | |||
177 | BEGIN TRANSACTION; | ||
178 | |||
179 | CREATE TABLE Tmp_users | ||
180 | ( | ||
181 | "UUID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), | ||
182 | "username" varchar(32) NOT NULL, | ||
183 | "lastname" varchar(32) NOT NULL, | ||
184 | "passwordHash" varchar(32) NOT NULL, | ||
185 | "passwordSalt" varchar(32) NOT NULL, | ||
186 | "homeRegion" bigint NULL DEFAULT (NULL), | ||
187 | "homeLocationX" double precision NULL DEFAULT (NULL), | ||
188 | "homeLocationY" double precision NULL DEFAULT (NULL), | ||
189 | "homeLocationZ" double precision NULL DEFAULT (NULL), | ||
190 | "homeLookAtX" double precision NULL DEFAULT (NULL), | ||
191 | "homeLookAtY" double precision NULL DEFAULT (NULL), | ||
192 | "homeLookAtZ" double precision NULL DEFAULT (NULL), | ||
193 | "created" int NOT NULL, | ||
194 | "lastLogin" int NOT NULL, | ||
195 | "userInventoryURI" varchar(255) NULL DEFAULT (NULL), | ||
196 | "userAssetURI" varchar(255) NULL DEFAULT (NULL), | ||
197 | "profileCanDoMask" int NULL DEFAULT (NULL), | ||
198 | "profileWantDoMask" int NULL DEFAULT (NULL), | ||
199 | "profileAboutText" text NULL, | ||
200 | "profileFirstText" text NULL, | ||
201 | "profileImage" uuid NULL DEFAULT (NULL), | ||
202 | "profileFirstImage" uuid NULL DEFAULT (NULL), | ||
203 | "webLoginKey" uuid NULL DEFAULT (NULL), | ||
204 | "homeRegionID" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), | ||
205 | "userFlags" int NOT NULL DEFAULT ((0)), | ||
206 | "godLevel" int NOT NULL DEFAULT ((0)), | ||
207 | "customType" varchar(32) NOT NULL DEFAULT (''), | ||
208 | "partner" uuid NOT NULL DEFAULT ('00000000-0000-0000-0000-000000000000'), | ||
209 | email varchar(250) NULL | ||
210 | ); | ||
211 | |||
212 | INSERT INTO Tmp_users ("UUID", "username", "lastname", "passwordHash", "passwordSalt", "homeRegion", "homeLocationX", "homeLocationY", "homeLocationZ", "homeLookAtX", "homeLookAtY", "homeLookAtZ", "created", "lastLogin", "userInventoryURI", "userAssetURI", "profileCanDoMask", "profileWantDoMask", "profileAboutText", "profileFirstText", "profileImage", "profileFirstImage", "webLoginKey", "homeRegionID", "userFlags", "godLevel", "customType", "partner", email) | ||
213 | SELECT cast("UUID" as uuid), "username", "lastname", "passwordHash", "passwordSalt", "homeRegion", "homeLocationX", "homeLocationY", "homeLocationZ", "homeLookAtX", "homeLookAtY", "homeLookAtZ", "created", "lastLogin", "userInventoryURI", "userAssetURI", "profileCanDoMask", "profileWantDoMask", "profileAboutText", "profileFirstText", cast("profileImage" as uuid), cast("profileFirstImage" as uuid), cast("webLoginKey" as uuid), cast("homeRegionID" as uuid), "userFlags", "godLevel", "customType", cast("partner" as uuid), email | ||
214 | FROM users ; | ||
215 | |||
216 | DROP TABLE users; | ||
217 | |||
218 | alter table Tmp_users rename to users; | ||
219 | |||
220 | ALTER TABLE users ADD CONSTRAINT | ||
221 | PK__users__65A475E737A5467C PRIMARY KEY | ||
222 | ( | ||
223 | "UUID" | ||
224 | ); | ||
225 | |||
226 | CREATE INDEX "usernames" ON users | ||
227 | ( | ||
228 | "username", | ||
229 | "lastname" | ||
230 | ); | ||
231 | |||
232 | COMMIT; | ||
233 | |||
234 | |||
235 | :VERSION 7 | ||
236 | |||
237 | BEGIN TRANSACTION; | ||
238 | |||
239 | CREATE TABLE Tmp_agents | ||
240 | ( | ||
241 | "UUID" uuid NOT NULL, | ||
242 | "sessionID" uuid NOT NULL, | ||
243 | "secureSessionID" uuid NOT NULL, | ||
244 | "agentIP" varchar(16) NOT NULL, | ||
245 | "agentPort" int NOT NULL, | ||
246 | "agentOnline" smallint NOT NULL, | ||
247 | "loginTime" int NOT NULL, | ||
248 | "logoutTime" int NOT NULL, | ||
249 | "currentRegion" uuid NOT NULL, | ||
250 | "currentHandle" bigint NOT NULL, | ||
251 | "currentPos" varchar(64) NOT NULL | ||
252 | ); | ||
253 | |||
254 | INSERT INTO Tmp_agents ("UUID", "sessionID", "secureSessionID", "agentIP", "agentPort", "agentOnline", "loginTime", "logoutTime", "currentRegion", "currentHandle", "currentPos") | ||
255 | SELECT cast("UUID" as uuid), cast("sessionID" as uuid), cast("secureSessionID" as uuid), "agentIP", "agentPort", "agentOnline", "loginTime", "logoutTime", cast("currentRegion" as uuid), "currentHandle", "currentPos" | ||
256 | FROM agents ; | ||
257 | |||
258 | DROP TABLE agents; | ||
259 | |||
260 | alter table Tmp_agents rename to agents; | ||
261 | |||
262 | ALTER TABLE agents ADD CONSTRAINT | ||
263 | PK__agents__65A475E749C3F6B7 PRIMARY KEY | ||
264 | ( | ||
265 | "UUID" | ||
266 | ) ; | ||
267 | |||
268 | CREATE INDEX session ON agents | ||
269 | ( | ||
270 | "sessionID" | ||
271 | ); | ||
272 | |||
273 | CREATE INDEX ssession ON agents | ||
274 | ( | ||
275 | "secureSessionID" | ||
276 | ); | ||
277 | |||
278 | COMMIT; | ||
279 | |||
280 | |||
281 | :VERSION 8 | ||
282 | |||
283 | BEGIN TRANSACTION; | ||
284 | |||
285 | CREATE TABLE Tmp_userfriends | ||
286 | ( | ||
287 | "ownerID" uuid NOT NULL, | ||
288 | "friendID" uuid NOT NULL, | ||
289 | "friendPerms" int NOT NULL, | ||
290 | "datetimestamp" int NOT NULL | ||
291 | ); | ||
292 | |||
293 | INSERT INTO Tmp_userfriends ("ownerID", "friendID", "friendPerms", "datetimestamp") | ||
294 | SELECT cast("ownerID" as uuid), cast( "friendID" as uuid), "friendPerms", "datetimestamp" | ||
295 | FROM userfriends; | ||
296 | |||
297 | DROP TABLE userfriends; | ||
298 | |||
299 | alter table Tmp_userfriends rename to userfriends; | ||
300 | |||
301 | CREATE INDEX IX_userfriends_ownerID ON userfriends | ||
302 | ( | ||
303 | "ownerID" | ||
304 | ); | ||
305 | |||
306 | CREATE INDEX IX_userfriends_friendID ON userfriends | ||
307 | ( | ||
308 | "friendID" | ||
309 | ); | ||
310 | |||
311 | COMMIT; | ||
312 | |||
313 | |||
314 | :VERSION 9 | ||
315 | |||
316 | BEGIN TRANSACTION; | ||
317 | |||
318 | CREATE TABLE Tmp_avatarappearance | ||
319 | ( | ||
320 | "Owner" uuid NOT NULL, | ||
321 | "Serial" int NOT NULL, | ||
322 | "Visual_Params" bytea NOT NULL, | ||
323 | "Texture" bytea NOT NULL, | ||
324 | "Avatar_Height" double precision NOT NULL, | ||
325 | "Body_Item" uuid NOT NULL, | ||
326 | "Body_Asset" uuid NOT NULL, | ||
327 | "Skin_Item" uuid NOT NULL, | ||
328 | "Skin_Asset" uuid NOT NULL, | ||
329 | "Hair_Item" uuid NOT NULL, | ||
330 | "Hair_Asset" uuid NOT NULL, | ||
331 | "Eyes_Item" uuid NOT NULL, | ||
332 | "Eyes_Asset" uuid NOT NULL, | ||
333 | "Shirt_Item" uuid NOT NULL, | ||
334 | "Shirt_Asset" uuid NOT NULL, | ||
335 | "Pants_Item" uuid NOT NULL, | ||
336 | "Pants_Asset" uuid NOT NULL, | ||
337 | "Shoes_Item" uuid NOT NULL, | ||
338 | "Shoes_Asset" uuid NOT NULL, | ||
339 | "Socks_Item" uuid NOT NULL, | ||
340 | "Socks_Asset" uuid NOT NULL, | ||
341 | "Jacket_Item" uuid NOT NULL, | ||
342 | "Jacket_Asset" uuid NOT NULL, | ||
343 | "Gloves_Item" uuid NOT NULL, | ||
344 | "Gloves_Asset" uuid NOT NULL, | ||
345 | "Undershirt_Item" uuid NOT NULL, | ||
346 | "Undershirt_Asset" uuid NOT NULL, | ||
347 | "Underpants_Item" uuid NOT NULL, | ||
348 | "Underpants_Asset" uuid NOT NULL, | ||
349 | "Skirt_Item" uuid NOT NULL, | ||
350 | "Skirt_Asset" uuid NOT NULL | ||
351 | ); | ||
352 | |||
353 | INSERT INTO Tmp_avatarappearance ("Owner", "Serial", "Visual_Params", "Texture", "Avatar_Height", "Body_Item", "Body_Asset", "Skin_Item", "Skin_Asset", "Hair_Item", "Hair_Asset", "Eyes_Item", "Eyes_Asset", "Shirt_Item", "Shirt_Asset", "Pants_Item", "Pants_Asset", "Shoes_Item", "Shoes_Asset", "Socks_Item", "Socks_Asset", "Jacket_Item", "Jacket_Asset", "Gloves_Item", "Gloves_Asset", "Undershirt_Item", "Undershirt_Asset", "Underpants_Item", "Underpants_Asset", "Skirt_Item", "Skirt_Asset") | ||
354 | SELECT cast("Owner" as uuid), "Serial", "Visual_Params", "Texture", "Avatar_Height", cast("Body_Item" as uuid), cast("Body_Asset" as uuid), cast("Skin_Item" as uuid), cast("Skin_Asset" as uuid), cast("Hair_Item" as uuid), cast("Hair_Asset" as uuid), cast("Eyes_Item" as uuid), cast("Eyes_Asset" as uuid), cast("Shirt_Item" as uuid), cast("Shirt_Asset" as uuid), cast("Pants_Item" as uuid), cast("Pants_Asset" as uuid), cast("Shoes_Item" as uuid), cast("Shoes_Asset" as uuid), cast("Socks_Item" as uuid), cast("Socks_Asset" as uuid), cast("Jacket_Item" as uuid), cast("Jacket_Asset" as uuid), cast("Gloves_Item" as uuid), cast("Gloves_Asset" as uuid), cast("Undershirt_Item" as uuid), cast("Undershirt_Asset" as uuid), cast("Underpants_Item" as uuid), cast("Underpants_Asset" as uuid), cast("Skirt_Item" as uuid), cast("Skirt_Asset" as uuid) | ||
355 | FROM avatarappearance ; | ||
356 | |||
357 | DROP TABLE avatarappearance; | ||
358 | |||
359 | alter table Tmp_avatarappearance rename to avatarappearance; | ||
360 | |||
361 | ALTER TABLE avatarappearance ADD CONSTRAINT | ||
362 | PK__avatarap__7DD115CC4E88ABD4 PRIMARY KEY | ||
363 | ( | ||
364 | "Owner" | ||
365 | ); | ||
366 | |||
367 | COMMIT; | ||
368 | |||
369 | |||
370 | :VERSION 10 | ||
371 | |||
372 | BEGIN TRANSACTION; | ||
373 | |||
374 | CREATE TABLE Tmp_avatarattachments | ||
375 | ( | ||
376 | "UUID" uuid NOT NULL, | ||
377 | "attachpoint" int NOT NULL, | ||
378 | item uuid NOT NULL, | ||
379 | asset uuid NOT NULL | ||
380 | ); | ||
381 | |||
382 | INSERT INTO Tmp_avatarattachments ("UUID", "attachpoint", item, asset) | ||
383 | SELECT cast("UUID" as uuid), "attachpoint", cast(item as uuid), cast(asset as uuid) | ||
384 | FROM avatarattachments ; | ||
385 | |||
386 | DROP TABLE avatarattachments; | ||
387 | |||
388 | alter table Tmp_avatarattachments rename to avatarattachments; | ||
389 | |||
390 | CREATE INDEX IX_avatarattachments ON avatarattachments | ||
391 | ( | ||
392 | "UUID" | ||
393 | ); | ||
394 | |||
395 | COMMIT; | ||
396 | |||
397 | |||
398 | :VERSION 11 | ||
399 | |||
400 | BEGIN TRANSACTION; | ||
401 | |||
402 | ALTER TABLE users ADD "scopeID" uuid not null default '00000000-0000-0000-0000-000000000000'; | ||
403 | |||
404 | COMMIT; | ||
diff --git a/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations b/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations new file mode 100644 index 0000000..df9d821 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations | |||
@@ -0,0 +1,80 @@ | |||
1 | # ----------------- | ||
2 | :VERSION 1 | ||
3 | |||
4 | BEGIN; | ||
5 | |||
6 | CREATE TABLE XAssetsMeta ( | ||
7 | "ID" char(36) NOT NULL, | ||
8 | "Hash" char(32) NOT NULL, | ||
9 | "Name" varchar(64) NOT NULL, | ||
10 | "Description" varchar(64) NOT NULL, | ||
11 | "AssetType" smallint NOT NULL, | ||
12 | "Local" smallint NOT NULL, | ||
13 | "Temporary" smallint NOT NULL, | ||
14 | "CreateTime" integer NOT NULL, | ||
15 | "AccessTime" integer NOT NULL, | ||
16 | "AssetFlags" integer NOT NULL, | ||
17 | "CreatorID" varchar(128) NOT NULL, | ||
18 | PRIMARY KEY ("ID") | ||
19 | ); | ||
20 | |||
21 | CREATE TABLE XAssetsData ( | ||
22 | "Hash" char(32) NOT NULL, | ||
23 | "Data" bytea NOT NULL, | ||
24 | PRIMARY KEY ("Hash") | ||
25 | ); | ||
26 | |||
27 | COMMIT; | ||
28 | |||
29 | |||
30 | :VERSION 2 | ||
31 | |||
32 | BEGIN; | ||
33 | |||
34 | ALTER TABLE xassetsmeta ALTER COLUMN "Local" SET DATA TYPE boolean USING CASE WHEN '0' THEN FALSE ELSE TRUE END; | ||
35 | ALTER TABLE xassetsmeta ALTER COLUMN "Temporary" SET DATA TYPE boolean USING CASE WHEN '0' THEN FALSE ELSE TRUE END; | ||
36 | ALTER TABLE xassetsmeta ALTER COLUMN "Hash" SET DATA TYPE char(66); | ||
37 | ALTER TABLE xassetsdata ALTER COLUMN "Hash" SET DATA TYPE char(66); | ||
38 | |||
39 | COMMIT; | ||
40 | |||
41 | :VERSION 3 | ||
42 | |||
43 | BEGIN; | ||
44 | |||
45 | ALTER TABLE xassetsmeta RENAME COLUMN "ID" TO id; | ||
46 | ALTER TABLE xassetsmeta RENAME COLUMN "Hash" TO hash; | ||
47 | ALTER TABLE xassetsmeta RENAME COLUMN "Name" TO name; | ||
48 | ALTER TABLE xassetsmeta RENAME COLUMN "Description" TO description; | ||
49 | ALTER TABLE xassetsmeta RENAME COLUMN "Local" to local; | ||
50 | ALTER TABLE xassetsmeta RENAME COLUMN "Temporary" TO temporary; | ||
51 | ALTER TABLE xassetsmeta RENAME COLUMN "CreateTime" TO create_time; | ||
52 | ALTER TABLE xassetsmeta RENAME COLUMN "AccessTime" TO access_time; | ||
53 | ALTER TABLE xassetsmeta RENAME COLUMN "AssetFlags" TO asset_flags; | ||
54 | ALTER TABLE xassetsmeta RENAME COLUMN "CreatorID" TO creatorid; | ||
55 | ALTER TABLE xassetsmeta DROP CONSTRAINT xassetsmeta_pkey; | ||
56 | ALTER TABLE xassetsmeta ADD PRIMARY KEY (id); | ||
57 | |||
58 | |||
59 | ALTER TABLE xassetsdata RENAME COLUMN "Hash" TO hash; | ||
60 | ALTER TABLE xassetsdata RENAME COLUMN "Data" TO data; | ||
61 | ALTER TABLE xassetsdata DROP CONSTRAINT xassetsdata_pkey; | ||
62 | ALTER TABLE xassetsdata ADD PRIMARY KEY (hash); | ||
63 | |||
64 | COMMIT; | ||
65 | |||
66 | |||
67 | :VERSION 4 | ||
68 | |||
69 | BEGIN; | ||
70 | |||
71 | ALTER TABLE xassetsmeta ALTER COLUMN id SET DATA TYPE uuid USING id::uuid; | ||
72 | ALTER TABLE xassetsmeta ALTER COLUMN hash SET DATA TYPE bytea USING hash::bytea; | ||
73 | ALTER TABLE xassetsdata ALTER COLUMN hash SET DATA TYPE bytea USING hash::bytea; | ||
74 | |||
75 | COMMIT; | ||
76 | |||
77 | :VERSION 5 | ||
78 | |||
79 | BEGIN; | ||
80 | COMMIT; | ||
diff --git a/OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations b/OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations new file mode 100644 index 0000000..74b07c3 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations | |||
@@ -0,0 +1,211 @@ | |||
1 | :VERSION 1 # -------------------------- | ||
2 | |||
3 | BEGIN; | ||
4 | |||
5 | CREATE TABLE os_groups_groups ( | ||
6 | "GroupID" char(36) Primary Key NOT NULL default '', | ||
7 | "Location" varchar(255) NOT NULL default '', | ||
8 | "Name" varchar(255) NOT NULL default '', | ||
9 | "Charter" text NOT NULL, | ||
10 | "InsigniaID" char(36) NOT NULL default '', | ||
11 | "FounderID" char(36) NOT NULL default '', | ||
12 | "MembershipFee" integer NOT NULL default '0', | ||
13 | "OpenEnrollment" varchar(255) NOT NULL default '', | ||
14 | "ShowInList" integer NOT NULL default '0', | ||
15 | "AllowPublish" integer NOT NULL default '0', | ||
16 | "MaturePublish" integer NOT NULL default '0', | ||
17 | "OwnerRoleID" char(36) NOT NULL default '' | ||
18 | ); | ||
19 | |||
20 | |||
21 | CREATE TABLE os_groups_membership ( | ||
22 | "GroupID"char(36) NOT NULL default '', | ||
23 | "PrincipalID" VARCHAR(255) NOT NULL default '', | ||
24 | "SelectedRoleID" char(36) NOT NULL default '', | ||
25 | "Contribution" integer NOT NULL default '0', | ||
26 | "ListInProfile" integer NOT NULL default '1', | ||
27 | "AcceptNotices" integer NOT NULL default '1', | ||
28 | "AccessToken" char(36) NOT NULL default '', | ||
29 | constraint os_groupmemberpk primary key ("GroupID", "PrincipalID") | ||
30 | ); | ||
31 | |||
32 | |||
33 | |||
34 | CREATE TABLE os_groups_roles ( | ||
35 | "GroupID" char(36) NOT NULL default '', | ||
36 | "RoleID" char(36) NOT NULL default '', | ||
37 | "Name" varchar(255) NOT NULL default '', | ||
38 | "Description" varchar(255) NOT NULL default '', | ||
39 | "Title" varchar(255) NOT NULL default '', | ||
40 | "Powers" bigint NOT NULL default 0, | ||
41 | constraint os_grouprolepk PRIMARY KEY ("GroupID","RoleID") | ||
42 | ); | ||
43 | |||
44 | |||
45 | CREATE TABLE os_groups_rolemembership ( | ||
46 | "GroupID" char(36) NOT NULL default '', | ||
47 | "RoleID" char(36) NOT NULL default '', | ||
48 | "PrincipalID" VARCHAR(255) NOT NULL default '', | ||
49 | constraint os_grouprolememberpk PRIMARY KEY ("GroupID","RoleID","PrincipalID") | ||
50 | ); | ||
51 | |||
52 | |||
53 | CREATE TABLE os_groups_invites ( | ||
54 | "InviteID" char(36) NOT NULL default '', | ||
55 | "GroupID" char(36) NOT NULL default '', | ||
56 | "RoleID" char(36) NOT NULL default '', | ||
57 | "PrincipalID" VARCHAR(255) NOT NULL default '', | ||
58 | "TMStamp" timestamp NOT NULL default now(), | ||
59 | constraint os_groupinvitespk PRIMARY KEY ("InviteID") | ||
60 | ); | ||
61 | -- UNIQUE KEY "PrincipalGroup" ("GroupID","PrincipalID") | ||
62 | |||
63 | |||
64 | CREATE TABLE os_groups_notices ( | ||
65 | "GroupID" char(36) NOT NULL default '', | ||
66 | "NoticeID" char(36) NOT NULL default '', | ||
67 | "TMStamp" integer NOT NULL default '0', | ||
68 | "FromName" varchar(255) NOT NULL default '', | ||
69 | "Subject" varchar(255) NOT NULL default '', | ||
70 | "Message" text NOT NULL, | ||
71 | "HasAttachment" integer NOT NULL default '0', | ||
72 | "AttachmentType" integer NOT NULL default '0', | ||
73 | "AttachmentName" varchar(128) NOT NULL default '', | ||
74 | "AttachmentItemID" char(36) NOT NULL default '', | ||
75 | "AttachmentOwnerID" varchar(255) NOT NULL default '', | ||
76 | constraint os_groupsnoticespk PRIMARY KEY ("NoticeID") | ||
77 | ); | ||
78 | -- KEY "GroupID" ("GroupID"), | ||
79 | -- KEY "TMStamp" ("TMStamp") | ||
80 | |||
81 | CREATE TABLE os_groups_principals ( | ||
82 | "PrincipalID" VARCHAR(255) NOT NULL default '', | ||
83 | "ActiveGroupID" char(36) NOT NULL default '', | ||
84 | constraint os_groupprincpk PRIMARY KEY ("PrincipalID") | ||
85 | ); | ||
86 | |||
87 | COMMIT; | ||
88 | |||
89 | :VERSION 2 # -------------------------- | ||
90 | |||
91 | BEGIN; | ||
92 | |||
93 | |||
94 | COMMIT; | ||
95 | |||
96 | |||
97 | |||
98 | :VERSION 3 | ||
99 | |||
100 | BEGIN; | ||
101 | |||
102 | -- Not a pretty way to do this, but it did not work as-is | ||
103 | -- and nothing was found about converting between existing data | ||
104 | -- and the new type. | ||
105 | -- Since there should be nothing to preserve ... | ||
106 | |||
107 | DROP TABLE IF EXISTS os_groups_groups CASCADE; | ||
108 | |||
109 | CREATE TABLE os_groups_groups ( | ||
110 | "GroupID" uuid PRIMARY KEY NOT NULL, | ||
111 | "Location" varchar(255) NOT NULL DEFAULT '', | ||
112 | "Name" varchar(255) NOT NULL DEFAULT '', | ||
113 | "Charter" text NOT NULL, | ||
114 | "InsigniaID" uuid NOT NULL, | ||
115 | "FounderID" uuid NOT NULL, | ||
116 | "MembershipFee" integer NOT NULL DEFAULT '0', | ||
117 | "OpenEnrollment" varchar(255) NOT NULL DEFAULT '', | ||
118 | "ShowInList" integer NOT NULL DEFAULT '0', | ||
119 | "AllowPublish" integer NOT NULL DEFAULT '0', | ||
120 | "MaturePublish" integer NOT NULL DEFAULT '0', | ||
121 | "OwnerRoleID" uuid NOT NULL | ||
122 | ); | ||
123 | |||
124 | |||
125 | DROP TABLE IF EXISTS os_groups_membership; | ||
126 | |||
127 | CREATE TABLE os_groups_membership ( | ||
128 | "GroupID"uuid NOT NULL, | ||
129 | "PrincipalID" VARCHAR(255) NOT NULL DEFAULT '', | ||
130 | "SelectedRoleID" uuid NOT NULL, | ||
131 | "Contribution" integer NOT NULL DEFAULT '0', | ||
132 | "ListInProfile" integer NOT NULL DEFAULT '1', | ||
133 | "AcceptNotices" integer NOT NULL DEFAULT '1', | ||
134 | "AccessToken" uuid NOT NULL, | ||
135 | constraint os_groupmemberpk PRIMARY KEY ("GroupID", "PrincipalID") | ||
136 | ); | ||
137 | |||
138 | |||
139 | |||
140 | DROP TABLE IF EXISTS os_groups_roles; | ||
141 | |||
142 | CREATE TABLE os_groups_roles ( | ||
143 | "GroupID" uuid NOT NULL, | ||
144 | "RoleID" uuid NOT NULL, | ||
145 | "Name" varchar(255) NOT NULL DEFAULT '', | ||
146 | "Description" varchar(255) NOT NULL DEFAULT '', | ||
147 | "Title" varchar(255) NOT NULL DEFAULT '', | ||
148 | "Powers" varchar(36) NOT NULL DEFAULT '', | ||
149 | constraint os_grouprolepk PRIMARY KEY ("GroupID","RoleID") | ||
150 | ); | ||
151 | |||
152 | |||
153 | DROP TABLE IF EXISTS os_groups_rolemembership; | ||
154 | |||
155 | CREATE TABLE os_groups_rolemembership ( | ||
156 | "GroupID" uuid NOT NULL, | ||
157 | "RoleID" uuid NOT NULL, | ||
158 | "PrincipalID" VARCHAR(255) NOT NULL DEFAULT '', | ||
159 | constraint os_grouprolememberpk PRIMARY KEY ("GroupID","RoleID","PrincipalID") | ||
160 | ); | ||
161 | |||
162 | |||
163 | DROP TABLE IF EXISTS os_groups_invites; | ||
164 | |||
165 | CREATE TABLE os_groups_invites ( | ||
166 | "InviteID" uuid NOT NULL, | ||
167 | "GroupID" uuid NOT NULL, | ||
168 | "RoleID" uuid NOT NULL, | ||
169 | "PrincipalID" VARCHAR(255) NOT NULL DEFAULT '', | ||
170 | "TMStamp" timestamp NOT NULL DEFAULT now(), | ||
171 | constraint os_groupinvitespk PRIMARY KEY ("InviteID") | ||
172 | ); | ||
173 | |||
174 | |||
175 | DROP TABLE IF EXISTS os_groups_notices; | ||
176 | |||
177 | CREATE TABLE os_groups_notices ( | ||
178 | "GroupID" uuid NOT NULL, | ||
179 | "NoticeID" uuid NOT NULL, | ||
180 | "TMStamp" integer NOT NULL DEFAULT '0', | ||
181 | "FromName" varchar(255) NOT NULL DEFAULT '', | ||
182 | "Subject" varchar(255) NOT NULL DEFAULT '', | ||
183 | "Message" text NOT NULL, | ||
184 | "HasAttachment" integer NOT NULL DEFAULT '0', | ||
185 | "AttachmentType" integer NOT NULL DEFAULT '0', | ||
186 | "AttachmentName" varchar(128) NOT NULL DEFAULT '', | ||
187 | "AttachmentItemID" uuid NOT NULL, | ||
188 | "AttachmentOwnerID" varchar(255) NOT NULL DEFAULT '', | ||
189 | constraint os_groupsnoticespk PRIMARY KEY ("NoticeID") | ||
190 | ); | ||
191 | |||
192 | |||
193 | DROP TABLE IF EXISTS os_groups_principals; | ||
194 | |||
195 | CREATE TABLE os_groups_principals ( | ||
196 | "PrincipalID" VARCHAR(255) NOT NULL DEFAULT '', | ||
197 | "ActiveGroupID" uuid NOT NULL, | ||
198 | constraint os_groupprincpk PRIMARY KEY ("PrincipalID") | ||
199 | ); | ||
200 | |||
201 | COMMIT; | ||
202 | |||
203 | :VERSION 4 | ||
204 | |||
205 | BEGIN; | ||
206 | |||
207 | ALTER TABLE IF EXISTS os_groups_notices | ||
208 | ALTER COLUMN "AttachmentItemID" SET DEFAULT '00000000-0000-0000-0000-000000000000' | ||
209 | ; | ||
210 | |||
211 | COMMIT; | ||