diff options
Diffstat (limited to 'OpenSim/Data/PGSQL/Resources/UserProfiles.migrations')
-rw-r--r-- | OpenSim/Data/PGSQL/Resources/UserProfiles.migrations | 155 |
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 | |||
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 | ||