aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/PGSQL/Resources/UserProfiles.migrations
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/PGSQL/Resources/UserProfiles.migrations')
-rw-r--r--OpenSim/Data/PGSQL/Resources/UserProfiles.migrations155
1 files changed, 155 insertions, 0 deletions
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
3begin;
4
5CREATE 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
25CREATE 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
33CREATE 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
51CREATE 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
69commit;
70
71:VERSION 2 # -------------------------------
72
73begin;
74CREATE 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
82commit;
83
84:VERSION 3 # -------------------------------
85begin;
86CREATE TABLE usersettings (
87 "useruuid" char(36) NOT NULL,
88 "imviaemail" bytea NOT NULL,
89 "visible" bytea NOT NULL,
90 PRIMARY KEY ("useruuid")
91);
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;
147
148
149:VERSION 5 # -------------------------------
150
151BEGIN;
152
153ALTER TABLE usersettings ALTER COLUMN imviaemail SET DATA TYPE boolean USING CASE WHEN false THEN false ELSE true END;
154
155COMMIT; \ No newline at end of file