aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/PGSQL/Resources
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/PGSQL/Resources')
-rw-r--r--OpenSim/Data/PGSQL/Resources/AssetStore.migrations5
-rw-r--r--OpenSim/Data/PGSQL/Resources/IM_Store.migrations19
-rwxr-xr-x[-rw-r--r--]OpenSim/Data/PGSQL/Resources/Presence.migrations18
-rw-r--r--OpenSim/Data/PGSQL/Resources/RegionStore.migrations8
-rw-r--r--OpenSim/Data/PGSQL/Resources/UserProfiles.migrations75
-rw-r--r--OpenSim/Data/PGSQL/Resources/XAssetStore.migrations53
-rw-r--r--OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations117
7 files changed, 292 insertions, 3 deletions
diff --git a/OpenSim/Data/PGSQL/Resources/AssetStore.migrations b/OpenSim/Data/PGSQL/Resources/AssetStore.migrations
index b6db585..7a858b4 100644
--- a/OpenSim/Data/PGSQL/Resources/AssetStore.migrations
+++ b/OpenSim/Data/PGSQL/Resources/AssetStore.migrations
@@ -92,3 +92,8 @@ ALTER TABLE assets ADD "asset_flags" INTEGER NOT NULL DEFAULT 0;
92:VERSION 7 92:VERSION 7
93 93
94alter table assets add "creatorid" varchar(36) not null default ''; 94alter table assets add "creatorid" varchar(36) not null default '';
95
96:VERSION 8
97
98BEGIN TRANSACTION;
99COMMIT;
diff --git a/OpenSim/Data/PGSQL/Resources/IM_Store.migrations b/OpenSim/Data/PGSQL/Resources/IM_Store.migrations
index 70dc011..eb97824 100644
--- a/OpenSim/Data/PGSQL/Resources/IM_Store.migrations
+++ b/OpenSim/Data/PGSQL/Resources/IM_Store.migrations
@@ -24,3 +24,22 @@ DELETE FROM `migrations` WHERE name='diva_im_Store';
24*/ 24*/
25 25
26COMMIT; 26COMMIT;
27
28:VERSION 3 # --------------------------
29
30BEGIN;
31
32-- dropping the table here as there most likely is only one record in the table at the time of migration
33
34DROP TABLE IF EXISTS "public"."im_offline";
35CREATE 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)
42WITH (OIDS=FALSE);
43ALTER TABLE "public"."im_offline" ADD PRIMARY KEY ("ID","PrincipalID","FromID") NOT DEFERRABLE INITIALLY IMMEDIATE;
44
45COMMIT; \ No newline at end of file
diff --git a/OpenSim/Data/PGSQL/Resources/Presence.migrations b/OpenSim/Data/PGSQL/Resources/Presence.migrations
index 684faa2..5184034 100644..100755
--- a/OpenSim/Data/PGSQL/Resources/Presence.migrations
+++ b/OpenSim/Data/PGSQL/Resources/Presence.migrations
@@ -19,12 +19,24 @@ BEGIN TRANSACTION;
19CREATE UNIQUE INDEX SessionID ON Presence("SessionID"); 19CREATE UNIQUE INDEX SessionID ON Presence("SessionID");
20CREATE INDEX UserID ON Presence("UserID"); 20CREATE INDEX UserID ON Presence("UserID");
21 21
22ALTER TABLE Presence ADD "LastSeen" Timestamp;
23
22COMMIT; 24COMMIT;
23 25
24:VERSION 2 26:VERSION 3 # --------------------------
25 27
26BEGIN TRANSACTION; 28BEGIN;
27 29
28ALTER TABLE Presence ADD "LastSeen" Timestamp; 30CREATE INDEX RegionID ON Presence("RegionID");
29 31
30COMMIT; 32COMMIT;
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
36BEGIN;
37
38ALTER TABLE Presence
39DROP COLUMN IF EXISTS "LastSeen",
40ADD COLUMN "LastSeen" Timestamp;
41
42COMMIT; \ No newline at end of file
diff --git a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
index 1e33027..1284ce0 100644
--- a/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/PGSQL/Resources/RegionStore.migrations
@@ -1152,3 +1152,11 @@ ALTER TABLE regionwindlight ALTER draw_classic_clouds TYPE bool USING CASE WHEN
1152ALTER TABLE regionwindlight ALTER COLUMN draw_classic_clouds SET DEFAULT FALSE; 1152ALTER TABLE regionwindlight ALTER COLUMN draw_classic_clouds SET DEFAULT FALSE;
1153 1153
1154COMMIT; 1154COMMIT;
1155
1156VERSION 41 #-- Change Landlags to bigint
1157
1158BEGIN TRANSACTION;
1159
1160ALTER TABLE land ALTER "LandFlags" TYPE bigint;
1161
1162COMMIT;
diff --git a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations
index f23c870..a67107a 100644
--- a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations
+++ b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations
@@ -81,3 +81,78 @@ CREATE TABLE userdata (
81 81
82commit; 82commit;
83 83
84<<<<<<< HEAD
85:VERSION 3 # -------------------------------
86begin;
87CREATE TABLE usersettings (
88 "useruuid" char(36) NOT NULL,
89 "imviaemail" bytea NOT NULL,
90 "visible" bytea NOT NULL,
91 PRIMARY KEY ("useruuid")
92);
93commit;
94
95:VERSION 4
96
97BEGIN;
98
99-- Classifieds
100ALTER TABLE classifieds DROP CONSTRAINT classifiedspk;
101ALTER TABLE classifieds ALTER COLUMN classifieduuid SET DATA TYPE uuid using classifieduuid::uuid;
102ALTER TABLE classifieds ALTER COLUMN creatoruuid SET DATA TYPE uuid using creatoruuid::uuid;
103ALTER TABLE classifieds ALTER COLUMN parceluuid SET DATA TYPE uuid using parceluuid::uuid;
104ALTER TABLE classifieds ALTER COLUMN snapshotuuid SET DATA TYPE uuid using snapshotuuid::uuid;
105ALTER TABLE classifieds ADD CONSTRAINT classifiedspk PRIMARY KEY (classifieduuid);
106
107-- Notes
108ALTER TABLE usernotes DROP CONSTRAINT usernoteuk;
109ALTER TABLE usernotes ALTER COLUMN useruuid SET DATA TYPE uuid USING useruuid::uuid;
110ALTER TABLE usernotes ALTER COLUMN targetuuid SET DATA TYPE uuid USING targetuuid::uuid;
111ALTER TABLE usernotes ADD CONSTRAINT usernoteuk UNIQUE (useruuid,targetuuid);
112
113
114-- Userpicks
115ALTER TABLE userpicks DROP CONSTRAINT userpicks_pkey;
116ALTER TABLE userpicks ALTER COLUMN pickuuid SET DATA TYPE uuid USING pickuuid::uuid;
117ALTER TABLE userpicks ALTER COLUMN creatoruuid SET DATA TYPE uuid USING creatoruuid::uuid;
118ALTER TABLE userpicks ALTER COLUMN parceluuid SET DATA TYPE uuid USING parceluuid::uuid;
119ALTER TABLE userpicks ALTER COLUMN parceluuid SET DATA TYPE uuid USING parceluuid::uuid;
120ALTER TABLE userpicks ADD PRIMARY KEY (pickuuid);
121
122-- Userprofile
123ALTER TABLE userprofile DROP CONSTRAINT userprofile_pkey;
124ALTER TABLE userprofile ALTER COLUMN useruuid SET DATA TYPE uuid USING useruuid::uuid;
125ALTER TABLE userprofile ALTER COLUMN "profilePartner" SET DATA TYPE uuid USING "profilePartner"::uuid;
126-- Force column conversions
127ALTER TABLE userprofile ALTER COLUMN "profileAllowPublish" SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END;
128ALTER TABLE userprofile ALTER COLUMN "profileMaturePublish" SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END;
129ALTER TABLE userprofile ALTER COLUMN "profileImage" SET DATA TYPE uuid USING "profileImage"::uuid;
130ALTER TABLE userprofile ALTER COLUMN "profileFirstImage" SET DATA TYPE uuid USING "profileFirstImage"::uuid;
131ALTER TABLE userprofile ADD PRIMARY KEY (useruuid);
132
133-- Userdata
134ALTER TABLE userdata DROP CONSTRAINT userdata_pkey;
135ALTER TABLE userdata ALTER COLUMN "UserId" SET DATA TYPE uuid USING "UserId"::uuid;
136ALTER TABLE userdata ALTER COLUMN "UserId" SET DATA TYPE uuid USING "UserId"::uuid;
137ALTER TABLE userdata ADD PRIMARY KEY ("UserId","TagId");
138
139
140-- Usersettings
141ALTER TABLE usersettings DROP CONSTRAINT usersettings_pkey;
142ALTER TABLE usersettings ALTER COLUMN useruuid SET DATA TYPE uuid USING useruuid::uuid;
143ALTER TABLE usersettings ALTER COLUMN visible SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END;
144ALTER TABLE usersettings ADD COLUMN email varchar(254) NOT NULL;
145ALTER TABLE usersettings ADD PRIMARY KEY (useruuid);
146
147COMMIT;
148
149
150:VERSION 5 # -------------------------------
151
152BEGIN;
153
154ALTER TABLE usersettings ALTER COLUMN imviaemail SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END;
155
156COMMIT;
157=======
158>>>>>>> avn/ubitvar
diff --git a/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations b/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations
index 325ed0d..df9d821 100644
--- a/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations
+++ b/OpenSim/Data/PGSQL/Resources/XAssetStore.migrations
@@ -25,3 +25,56 @@ CREATE TABLE XAssetsData (
25); 25);
26 26
27COMMIT; 27COMMIT;
28
29
30:VERSION 2
31
32BEGIN;
33
34ALTER TABLE xassetsmeta ALTER COLUMN "Local" SET DATA TYPE boolean USING CASE WHEN '0' THEN FALSE ELSE TRUE END;
35ALTER TABLE xassetsmeta ALTER COLUMN "Temporary" SET DATA TYPE boolean USING CASE WHEN '0' THEN FALSE ELSE TRUE END;
36ALTER TABLE xassetsmeta ALTER COLUMN "Hash" SET DATA TYPE char(66);
37ALTER TABLE xassetsdata ALTER COLUMN "Hash" SET DATA TYPE char(66);
38
39COMMIT;
40
41:VERSION 3
42
43BEGIN;
44
45ALTER TABLE xassetsmeta RENAME COLUMN "ID" TO id;
46ALTER TABLE xassetsmeta RENAME COLUMN "Hash" TO hash;
47ALTER TABLE xassetsmeta RENAME COLUMN "Name" TO name;
48ALTER TABLE xassetsmeta RENAME COLUMN "Description" TO description;
49ALTER TABLE xassetsmeta RENAME COLUMN "Local" to local;
50ALTER TABLE xassetsmeta RENAME COLUMN "Temporary" TO temporary;
51ALTER TABLE xassetsmeta RENAME COLUMN "CreateTime" TO create_time;
52ALTER TABLE xassetsmeta RENAME COLUMN "AccessTime" TO access_time;
53ALTER TABLE xassetsmeta RENAME COLUMN "AssetFlags" TO asset_flags;
54ALTER TABLE xassetsmeta RENAME COLUMN "CreatorID" TO creatorid;
55ALTER TABLE xassetsmeta DROP CONSTRAINT xassetsmeta_pkey;
56ALTER TABLE xassetsmeta ADD PRIMARY KEY (id);
57
58
59ALTER TABLE xassetsdata RENAME COLUMN "Hash" TO hash;
60ALTER TABLE xassetsdata RENAME COLUMN "Data" TO data;
61ALTER TABLE xassetsdata DROP CONSTRAINT xassetsdata_pkey;
62ALTER TABLE xassetsdata ADD PRIMARY KEY (hash);
63
64COMMIT;
65
66
67:VERSION 4
68
69BEGIN;
70
71ALTER TABLE xassetsmeta ALTER COLUMN id SET DATA TYPE uuid USING id::uuid;
72ALTER TABLE xassetsmeta ALTER COLUMN hash SET DATA TYPE bytea USING hash::bytea;
73ALTER TABLE xassetsdata ALTER COLUMN hash SET DATA TYPE bytea USING hash::bytea;
74
75COMMIT;
76
77:VERSION 5
78
79BEGIN;
80COMMIT;
diff --git a/OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations b/OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations
index 4573f71..74b07c3 100644
--- a/OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations
+++ b/OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations
@@ -92,3 +92,120 @@ BEGIN;
92 92
93 93
94COMMIT; 94COMMIT;
95
96
97
98:VERSION 3
99
100BEGIN;
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
107DROP TABLE IF EXISTS os_groups_groups CASCADE;
108
109CREATE 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
125DROP TABLE IF EXISTS os_groups_membership;
126
127CREATE 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
140DROP TABLE IF EXISTS os_groups_roles;
141
142CREATE 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
153DROP TABLE IF EXISTS os_groups_rolemembership;
154
155CREATE 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
163DROP TABLE IF EXISTS os_groups_invites;
164
165CREATE 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
175DROP TABLE IF EXISTS os_groups_notices;
176
177CREATE 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
193DROP TABLE IF EXISTS os_groups_principals;
194
195CREATE 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
201COMMIT;
202
203:VERSION 4
204
205BEGIN;
206
207ALTER TABLE IF EXISTS os_groups_notices
208 ALTER COLUMN "AttachmentItemID" SET DEFAULT '00000000-0000-0000-0000-000000000000'
209;
210
211COMMIT;