diff options
Diffstat (limited to 'OpenSim/Data/PGSQL/Resources/GridStore.migrations')
-rw-r--r-- | OpenSim/Data/PGSQL/Resources/GridStore.migrations | 242 |
1 files changed, 242 insertions, 0 deletions
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 | |||