diff options
Diffstat (limited to 'OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations')
-rw-r--r-- | OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations | 211 |
1 files changed, 211 insertions, 0 deletions
diff --git a/OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations b/OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations new file mode 100644 index 0000000..74b07c3 --- /dev/null +++ b/OpenSim/Data/PGSQL/Resources/os_groups_Store.migrations | |||
@@ -0,0 +1,211 @@ | |||
1 | :VERSION 1 # -------------------------- | ||
2 | |||
3 | BEGIN; | ||
4 | |||
5 | CREATE TABLE os_groups_groups ( | ||
6 | "GroupID" char(36) Primary Key NOT NULL default '', | ||
7 | "Location" varchar(255) NOT NULL default '', | ||
8 | "Name" varchar(255) NOT NULL default '', | ||
9 | "Charter" text NOT NULL, | ||
10 | "InsigniaID" char(36) NOT NULL default '', | ||
11 | "FounderID" char(36) NOT NULL default '', | ||
12 | "MembershipFee" integer NOT NULL default '0', | ||
13 | "OpenEnrollment" varchar(255) NOT NULL default '', | ||
14 | "ShowInList" integer NOT NULL default '0', | ||
15 | "AllowPublish" integer NOT NULL default '0', | ||
16 | "MaturePublish" integer NOT NULL default '0', | ||
17 | "OwnerRoleID" char(36) NOT NULL default '' | ||
18 | ); | ||
19 | |||
20 | |||
21 | CREATE TABLE os_groups_membership ( | ||
22 | "GroupID"char(36) NOT NULL default '', | ||
23 | "PrincipalID" VARCHAR(255) NOT NULL default '', | ||
24 | "SelectedRoleID" char(36) NOT NULL default '', | ||
25 | "Contribution" integer NOT NULL default '0', | ||
26 | "ListInProfile" integer NOT NULL default '1', | ||
27 | "AcceptNotices" integer NOT NULL default '1', | ||
28 | "AccessToken" char(36) NOT NULL default '', | ||
29 | constraint os_groupmemberpk primary key ("GroupID", "PrincipalID") | ||
30 | ); | ||
31 | |||
32 | |||
33 | |||
34 | CREATE TABLE os_groups_roles ( | ||
35 | "GroupID" char(36) NOT NULL default '', | ||
36 | "RoleID" char(36) NOT NULL default '', | ||
37 | "Name" varchar(255) NOT NULL default '', | ||
38 | "Description" varchar(255) NOT NULL default '', | ||
39 | "Title" varchar(255) NOT NULL default '', | ||
40 | "Powers" bigint NOT NULL default 0, | ||
41 | constraint os_grouprolepk PRIMARY KEY ("GroupID","RoleID") | ||
42 | ); | ||
43 | |||
44 | |||
45 | CREATE TABLE os_groups_rolemembership ( | ||
46 | "GroupID" char(36) NOT NULL default '', | ||
47 | "RoleID" char(36) NOT NULL default '', | ||
48 | "PrincipalID" VARCHAR(255) NOT NULL default '', | ||
49 | constraint os_grouprolememberpk PRIMARY KEY ("GroupID","RoleID","PrincipalID") | ||
50 | ); | ||
51 | |||
52 | |||
53 | CREATE TABLE os_groups_invites ( | ||
54 | "InviteID" char(36) NOT NULL default '', | ||
55 | "GroupID" char(36) NOT NULL default '', | ||
56 | "RoleID" char(36) NOT NULL default '', | ||
57 | "PrincipalID" VARCHAR(255) NOT NULL default '', | ||
58 | "TMStamp" timestamp NOT NULL default now(), | ||
59 | constraint os_groupinvitespk PRIMARY KEY ("InviteID") | ||
60 | ); | ||
61 | -- UNIQUE KEY "PrincipalGroup" ("GroupID","PrincipalID") | ||
62 | |||
63 | |||
64 | CREATE TABLE os_groups_notices ( | ||
65 | "GroupID" char(36) NOT NULL default '', | ||
66 | "NoticeID" char(36) NOT NULL default '', | ||
67 | "TMStamp" integer NOT NULL default '0', | ||
68 | "FromName" varchar(255) NOT NULL default '', | ||
69 | "Subject" varchar(255) NOT NULL default '', | ||
70 | "Message" text NOT NULL, | ||
71 | "HasAttachment" integer NOT NULL default '0', | ||
72 | "AttachmentType" integer NOT NULL default '0', | ||
73 | "AttachmentName" varchar(128) NOT NULL default '', | ||
74 | "AttachmentItemID" char(36) NOT NULL default '', | ||
75 | "AttachmentOwnerID" varchar(255) NOT NULL default '', | ||
76 | constraint os_groupsnoticespk PRIMARY KEY ("NoticeID") | ||
77 | ); | ||
78 | -- KEY "GroupID" ("GroupID"), | ||
79 | -- KEY "TMStamp" ("TMStamp") | ||
80 | |||
81 | CREATE TABLE os_groups_principals ( | ||
82 | "PrincipalID" VARCHAR(255) NOT NULL default '', | ||
83 | "ActiveGroupID" char(36) NOT NULL default '', | ||
84 | constraint os_groupprincpk PRIMARY KEY ("PrincipalID") | ||
85 | ); | ||
86 | |||
87 | COMMIT; | ||
88 | |||
89 | :VERSION 2 # -------------------------- | ||
90 | |||
91 | BEGIN; | ||
92 | |||
93 | |||
94 | COMMIT; | ||
95 | |||
96 | |||
97 | |||
98 | :VERSION 3 | ||
99 | |||
100 | BEGIN; | ||
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 | |||
107 | DROP TABLE IF EXISTS os_groups_groups CASCADE; | ||
108 | |||
109 | CREATE 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 | |||
125 | DROP TABLE IF EXISTS os_groups_membership; | ||
126 | |||
127 | CREATE 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 | |||
140 | DROP TABLE IF EXISTS os_groups_roles; | ||
141 | |||
142 | CREATE 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 | |||
153 | DROP TABLE IF EXISTS os_groups_rolemembership; | ||
154 | |||
155 | CREATE 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 | |||
163 | DROP TABLE IF EXISTS os_groups_invites; | ||
164 | |||
165 | CREATE 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 | |||
175 | DROP TABLE IF EXISTS os_groups_notices; | ||
176 | |||
177 | CREATE 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 | |||
193 | DROP TABLE IF EXISTS os_groups_principals; | ||
194 | |||
195 | CREATE 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 | |||
201 | COMMIT; | ||
202 | |||
203 | :VERSION 4 | ||
204 | |||
205 | BEGIN; | ||
206 | |||
207 | ALTER TABLE IF EXISTS os_groups_notices | ||
208 | ALTER COLUMN "AttachmentItemID" SET DEFAULT '00000000-0000-0000-0000-000000000000' | ||
209 | ; | ||
210 | |||
211 | COMMIT; | ||