aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/PGSQL/Resources/UserProfiles.migrations56
1 files changed, 55 insertions, 1 deletions
diff --git a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations
index 4fcaa8e..1544b48 100644
--- a/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations
+++ b/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations
@@ -89,4 +89,58 @@ CREATE TABLE usersettings (
89 "visible" bytea NOT NULL, 89 "visible" bytea NOT NULL,
90 PRIMARY KEY ("useruuid") 90 PRIMARY KEY ("useruuid")
91); 91);
92commit; \ No newline at end of file 92commit;
93
94:VERSION 4
95
96BEGIN;
97
98-- Classifieds
99ALTER TABLE classifieds DROP CONSTRAINT classifiedspk;
100ALTER TABLE classifieds ALTER COLUMN classifieduuid SET DATA TYPE uuid using classifieduuid::uuid;
101ALTER TABLE classifieds ALTER COLUMN creatoruuid SET DATA TYPE uuid using creatoruuid::uuid;
102ALTER TABLE classifieds ALTER COLUMN parceluuid SET DATA TYPE uuid using parceluuid::uuid;
103ALTER TABLE classifieds ALTER COLUMN snapshotuuid SET DATA TYPE uuid using snapshotuuid::uuid;
104ALTER TABLE classifieds ADD CONSTRAINT classifiedspk PRIMARY KEY (classifieduuid);
105
106-- Notes
107ALTER TABLE usernotes DROP CONSTRAINT usernoteuk;
108ALTER TABLE usernotes ALTER COLUMN useruuid SET DATA TYPE uuid USING useruuid::uuid;
109ALTER TABLE usernotes ALTER COLUMN targetuuid SET DATA TYPE uuid USING targetuuid::uuid;
110ALTER TABLE usernotes ADD CONSTRAINT usernoteuk UNIQUE (useruuid,targetuuid);
111
112
113-- Userpicks
114ALTER TABLE userpicks DROP CONSTRAINT userpicks_pkey;
115ALTER TABLE userpicks ALTER COLUMN pickuuid SET DATA TYPE uuid USING pickuuid::uuid;
116ALTER TABLE userpicks ALTER COLUMN creatoruuid SET DATA TYPE uuid USING creatoruuid::uuid;
117ALTER TABLE userpicks ALTER COLUMN parceluuid SET DATA TYPE uuid USING parceluuid::uuid;
118ALTER TABLE userpicks ALTER COLUMN parceluuid SET DATA TYPE uuid USING parceluuid::uuid;
119ALTER TABLE userpicks ADD PRIMARY KEY (pickuuid);
120
121-- Userprofile
122ALTER TABLE userprofile DROP CONSTRAINT userprofile_pkey;
123ALTER TABLE userprofile ALTER COLUMN useruuid SET DATA TYPE uuid USING useruuid::uuid;
124ALTER TABLE userprofile ALTER COLUMN "profilePartner" SET DATA TYPE uuid USING "profilePartner"::uuid;
125-- Force column conversions
126ALTER TABLE userprofile ALTER COLUMN "profileAllowPublish" SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END;
127ALTER TABLE userprofile ALTER COLUMN "profileMaturePublish" SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END;
128ALTER TABLE userprofile ALTER COLUMN "profileImage" SET DATA TYPE uuid USING "profileImage"::uuid;
129ALTER TABLE userprofile ALTER COLUMN "profileFirstImage" SET DATA TYPE uuid USING "profileFirstImage"::uuid;
130ALTER TABLE userprofile ADD PRIMARY KEY (useruuid);
131
132-- Userdata
133ALTER TABLE userdata DROP CONSTRAINT userdata_pkey;
134ALTER TABLE userdata ALTER COLUMN "UserId" SET DATA TYPE uuid USING "UserId"::uuid;
135ALTER TABLE userdata ALTER COLUMN "UserId" SET DATA TYPE uuid USING "UserId"::uuid;
136ALTER TABLE userdata ADD PRIMARY KEY ("UserId","TagId");
137
138
139-- Usersettings
140ALTER TABLE usersettings DROP CONSTRAINT usersettings_pkey;
141ALTER TABLE usersettings ALTER COLUMN useruuid SET DATA TYPE uuid USING useruuid::uuid;
142ALTER TABLE usersettings ALTER COLUMN visible SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END;
143ALTER TABLE usersettings ADD COLUMN email varchar(254) NOT NULL;
144ALTER TABLE usersettings ADD PRIMARY KEY (useruuid);
145
146COMMIT; \ No newline at end of file