1 | -- clean the tables in the right order: |
---|
2 | |
---|
3 | DELETE FROM |
---|
4 | generic_lock |
---|
5 | ; |
---|
6 | DELETE FROM |
---|
7 | generic_name |
---|
8 | ; |
---|
9 | DELETE FROM |
---|
10 | generic_text |
---|
11 | ; |
---|
12 | |
---|
13 | DELETE FROM |
---|
14 | link_open_data_category_conceptual_domain |
---|
15 | ; |
---|
16 | DELETE FROM |
---|
17 | link_closed_data_category_conceptual_domains |
---|
18 | ; |
---|
19 | DELETE FROM |
---|
20 | link_constrained_data_category_conceptual_domains |
---|
21 | ; |
---|
22 | DELETE FROM |
---|
23 | link_constrained_linguistic_section_conceptual_domains |
---|
24 | ; |
---|
25 | DELETE FROM |
---|
26 | link_data_category_selection_users |
---|
27 | ; |
---|
28 | DELETE FROM |
---|
29 | link_group_members |
---|
30 | ; |
---|
31 | DELETE FROM |
---|
32 | link_profile_members |
---|
33 | ; |
---|
34 | DELETE FROM |
---|
35 | link_selected_data_category_picklist |
---|
36 | ; |
---|
37 | DELETE FROM |
---|
38 | link_selected_data_category_profiles |
---|
39 | ; |
---|
40 | DELETE FROM |
---|
41 | link_simple_data_category_super |
---|
42 | ; |
---|
43 | DELETE FROM |
---|
44 | link_value_domain_values |
---|
45 | ; |
---|
46 | |
---|
47 | DELETE FROM |
---|
48 | core_selected_container_data_category |
---|
49 | ; |
---|
50 | DELETE FROM |
---|
51 | core_selected_complex_data_category |
---|
52 | ; |
---|
53 | DELETE FROM |
---|
54 | core_selected_simple_data_category |
---|
55 | ; |
---|
56 | DELETE FROM |
---|
57 | core_selected_data_category |
---|
58 | ; |
---|
59 | |
---|
60 | DELETE FROM |
---|
61 | core_data_category_selection |
---|
62 | ; |
---|
63 | |
---|
64 | DELETE FROM |
---|
65 | core_registration_group |
---|
66 | ; |
---|
67 | DELETE FROM |
---|
68 | core_submission_group |
---|
69 | ; |
---|
70 | DELETE FROM |
---|
71 | core_decision_group |
---|
72 | ; |
---|
73 | |
---|
74 | DELETE FROM |
---|
75 | core_language_section |
---|
76 | ; |
---|
77 | |
---|
78 | DELETE FROM |
---|
79 | core_constrained_linguistic_section |
---|
80 | ; |
---|
81 | DELETE FROM |
---|
82 | core_closed_linguistic_section |
---|
83 | ; |
---|
84 | DELETE FROM |
---|
85 | core_linguistic_section |
---|
86 | ; |
---|
87 | |
---|
88 | DELETE FROM |
---|
89 | core_rule |
---|
90 | ; |
---|
91 | |
---|
92 | DELETE FROM |
---|
93 | core_profile_value_domain |
---|
94 | ; |
---|
95 | DELETE FROM |
---|
96 | core_value_domain |
---|
97 | ; |
---|
98 | DELETE FROM |
---|
99 | core_conceptual_domain_rule |
---|
100 | ; |
---|
101 | DELETE FROM |
---|
102 | core_open_conceptual_domain |
---|
103 | ; |
---|
104 | DELETE FROM |
---|
105 | core_conceptual_domain |
---|
106 | ; |
---|
107 | |
---|
108 | DELETE FROM |
---|
109 | core_closed_data_category |
---|
110 | ; |
---|
111 | DELETE FROM |
---|
112 | core_constrained_data_category |
---|
113 | ; |
---|
114 | DELETE FROM |
---|
115 | core_open_data_category |
---|
116 | ; |
---|
117 | DELETE FROM |
---|
118 | core_complex_data_category |
---|
119 | ; |
---|
120 | DELETE FROM |
---|
121 | core_simple_data_category |
---|
122 | ; |
---|
123 | DELETE FROM |
---|
124 | core_container_data_category |
---|
125 | ; |
---|
126 | DELETE FROM |
---|
127 | core_data_category |
---|
128 | ; |
---|
129 | |
---|
130 | DELETE FROM |
---|
131 | core_profile |
---|
132 | ; |
---|
133 | |
---|
134 | DELETE FROM |
---|
135 | core_session |
---|
136 | ; |
---|
137 | |
---|
138 | DELETE FROM |
---|
139 | core_message |
---|
140 | ; |
---|
141 | |
---|
142 | DELETE FROM |
---|
143 | core_thematic_domain_group |
---|
144 | ; |
---|
145 | DELETE FROM |
---|
146 | core_dcr_board |
---|
147 | ; |
---|
148 | DELETE FROM |
---|
149 | core_group |
---|
150 | ; |
---|
151 | DELETE FROM |
---|
152 | core_user |
---|
153 | ; |
---|
154 | DELETE FROM |
---|
155 | core_owner |
---|
156 | ; |
---|
157 | DELETE FROM |
---|
158 | core_account |
---|
159 | ; |
---|
160 | |
---|
161 | DELETE FROM |
---|
162 | core_registration_authority |
---|
163 | ; |
---|
164 | |
---|
165 | DELETE FROM |
---|
166 | core_language |
---|
167 | ; |
---|
168 | DELETE FROM |
---|
169 | core_data_type |
---|
170 | ; |
---|
171 | DELETE FROM |
---|
172 | core_rule_type |
---|
173 | ; |
---|
174 | |
---|
175 | -- reset sequences |
---|
176 | |
---|
177 | ALTER SEQUENCE core_account_id_seq RESTART WITH 1; |
---|
178 | |
---|
179 | ALTER SEQUENCE core_conceptual_domain_id_seq RESTART WITH 1; |
---|
180 | |
---|
181 | ALTER SEQUENCE core_data_category_id_seq RESTART WITH 1; |
---|
182 | |
---|
183 | ALTER SEQUENCE core_data_category_selection_id_seq RESTART WITH 1; |
---|
184 | |
---|
185 | ALTER SEQUENCE core_data_type_id_seq RESTART WITH 1; |
---|
186 | |
---|
187 | ALTER SEQUENCE core_language_id_seq RESTART WITH 1; |
---|
188 | |
---|
189 | ALTER SEQUENCE core_language_section_id_seq RESTART WITH 1; |
---|
190 | |
---|
191 | ALTER SEQUENCE core_linguistic_section_id_seq RESTART WITH 1; |
---|
192 | |
---|
193 | ALTER SEQUENCE core_message_id_seq RESTART WITH 1; |
---|
194 | |
---|
195 | ALTER SEQUENCE core_profile_id_seq RESTART WITH 1; |
---|
196 | |
---|
197 | ALTER SEQUENCE core_registration_authority_id_seq RESTART WITH 1; |
---|
198 | |
---|
199 | ALTER SEQUENCE core_rule_id_seq RESTART WITH 1; |
---|
200 | |
---|
201 | ALTER SEQUENCE core_rule_type_id_seq RESTART WITH 1; |
---|
202 | |
---|
203 | ALTER SEQUENCE core_selected_data_category_id_seq RESTART WITH 1; |
---|
204 | |
---|
205 | ALTER SEQUENCE core_session_id_seq RESTART WITH 1; |
---|
206 | |
---|
207 | ALTER SEQUENCE generic_lock_id_seq RESTART WITH 1; |
---|
208 | |
---|
209 | ALTER SEQUENCE generic_name_id_seq RESTART WITH 1; |
---|
210 | |
---|
211 | ALTER SEQUENCE generic_text_id_seq RESTART WITH 1; |
---|
212 | |
---|
213 | -- give some tables an initial filling |
---|
214 | |
---|
215 | -- the default languages |
---|
216 | |
---|
217 | INSERT INTO core_language (name, tag, search, tags) VALUES ('English', 'en', 'english', 'eng'); |
---|
218 | INSERT INTO core_language (name, tag, search) VALUES ('French', 'fr', 'french'); |
---|
219 | INSERT INTO core_language (name, tag, search) VALUES ('Japanese', 'ja', 'simple'); |
---|
220 | INSERT INTO core_language (name, tag, search) VALUES ('German', 'de', 'german'); |
---|
221 | INSERT INTO core_language (name, tag, search) VALUES ('Dutch', 'nl', 'dutch'); |
---|
222 | INSERT INTO core_language (name, tag, search) VALUES ('Czech', 'cs', 'simple'); |
---|
223 | INSERT INTO core_language (name, tag, search) VALUES ('Estonian', 'et', 'simple'); |
---|
224 | INSERT INTO core_language (name, tag, search) VALUES ('Finnish', 'fi', 'finnish'); |
---|
225 | INSERT INTO core_language (name, tag, search) VALUES ('Hungarian','hu', 'hungarian'); |
---|
226 | INSERT INTO core_language (name, tag, search) VALUES ('Italian', 'it', 'italian'); |
---|
227 | INSERT INTO core_language (name, tag, search) VALUES ('Korean', 'ko', 'simple'); |
---|
228 | INSERT INTO core_language (name, tag, search) VALUES ('Romanian', 'ro', 'romanian'); |
---|
229 | INSERT INTO core_language (name, tag, search) VALUES ('Russian', 'ru', 'russian'); |
---|
230 | INSERT INTO core_language (name, tag, search) VALUES ('Swedish', 'sv', 'swedish'); |
---|
231 | |
---|
232 | INSERT INTO core_language (name, tag, search) VALUES ('Bulgarian', 'bg', 'simple'); |
---|
233 | INSERT INTO core_language (name, tag, search) VALUES ('Croatian', 'hr', 'simple'); |
---|
234 | INSERT INTO core_language (name, tag, search) VALUES ('Danish', 'da', 'danish'); |
---|
235 | INSERT INTO core_language (name, tag, search) VALUES ('Greek', 'el', 'simple'); |
---|
236 | INSERT INTO core_language (name, tag, search) VALUES ('Icelandic', 'is', 'simple'); |
---|
237 | INSERT INTO core_language (name, tag, search) VALUES ('Irish', 'ga', 'simple'); |
---|
238 | INSERT INTO core_language (name, tag, search) VALUES ('Hebrew', 'he', 'simple'); |
---|
239 | INSERT INTO core_language (name, tag, search) VALUES ('Latvian', 'lv', 'simple'); |
---|
240 | INSERT INTO core_language (name, tag, search) VALUES ('Lithuanian', 'lt', 'simple'); |
---|
241 | INSERT INTO core_language (name, tag, search) VALUES ('Luxembourgish', 'lb', 'simple'); |
---|
242 | INSERT INTO core_language (name, tag, search) VALUES ('Maltese', 'mt', 'simple'); |
---|
243 | INSERT INTO core_language (name, tag, search) VALUES ('Norwegian', 'no', 'norwegian'); |
---|
244 | INSERT INTO core_language (name, tag, search) VALUES ('Polish', 'pl', 'simple'); |
---|
245 | INSERT INTO core_language (name, tag, search) VALUES ('Portuguese', 'pt', 'portuguese'); |
---|
246 | INSERT INTO core_language (name, tag, search) VALUES ('Serbian', 'sr', 'simple'); |
---|
247 | INSERT INTO core_language (name, tag, search) VALUES ('Slovene', 'sl', 'simple'); |
---|
248 | INSERT INTO core_language (name, tag, search) VALUES ('Spanish', 'es', 'spanish'); |
---|
249 | INSERT INTO core_language (name, tag, search) VALUES ('Turkish', 'tr', 'turkish'); |
---|
250 | INSERT INTO core_language (name, tag, search) VALUES ('Slovak', 'sk', 'simple'); |
---|
251 | |
---|
252 | INSERT INTO core_language (name, tag, search, tags) VALUES ('Welsh', 'cy', 'simple', 'cym'); |
---|
253 | |
---|
254 | INSERT INTO core_language (name, tag, search, direction) VALUES ('Arabic', 'ar', 'simple', 'rtl'); |
---|
255 | INSERT INTO core_language (name, tag, search, direction) VALUES ('Chinese', 'zh', 'simple', 'ltr'); |
---|
256 | |
---|
257 | -- the default data types |
---|
258 | |
---|
259 | INSERT INTO core_data_type (id, data_type, super) VALUES ( 2,'anyType',NULL); |
---|
260 | INSERT INTO core_data_type (id, data_type, super) VALUES ( 3,'anySimpleType',2); |
---|
261 | INSERT INTO core_data_type (id, data_type, super) VALUES ( 4,'duration',3); |
---|
262 | INSERT INTO core_data_type (id, data_type, super) VALUES ( 5,'dateTime',3); |
---|
263 | INSERT INTO core_data_type (id, data_type, super) VALUES ( 6,'time',3); |
---|
264 | INSERT INTO core_data_type (id, data_type, super) VALUES ( 7,'date',3); |
---|
265 | INSERT INTO core_data_type (id, data_type, super) VALUES ( 8,'gYearMonth',3); |
---|
266 | INSERT INTO core_data_type (id, data_type, super) VALUES ( 9,'gYear',3); |
---|
267 | INSERT INTO core_data_type (id, data_type, super) VALUES (10,'gMonthDay',3); |
---|
268 | INSERT INTO core_data_type (id, data_type, super) VALUES (11,'gDay',3); |
---|
269 | INSERT INTO core_data_type (id, data_type, super) VALUES (12,'gMonth',3); |
---|
270 | INSERT INTO core_data_type (id, data_type, super) VALUES (13,'boolean',3); |
---|
271 | INSERT INTO core_data_type (id, data_type, super) VALUES (14,'base64Binary',3); |
---|
272 | INSERT INTO core_data_type (id, data_type, super) VALUES (15,'hexBinary',3); |
---|
273 | INSERT INTO core_data_type (id, data_type, super) VALUES (16,'float',3); |
---|
274 | INSERT INTO core_data_type (id, data_type, super) VALUES (17,'double',3); |
---|
275 | INSERT INTO core_data_type (id, data_type, super) VALUES (18,'anyURI',3); |
---|
276 | INSERT INTO core_data_type (id, data_type, super) VALUES (19,'QName',3); |
---|
277 | INSERT INTO core_data_type (id, data_type, super) VALUES (20,'NOTATION',3); |
---|
278 | INSERT INTO core_data_type (id, data_type, super) VALUES ( 1,'string',3); |
---|
279 | INSERT INTO core_data_type (id, data_type, super) VALUES (21,'normalizedString',1); |
---|
280 | INSERT INTO core_data_type (id, data_type, super) VALUES (22,'token',21); |
---|
281 | INSERT INTO core_data_type (id, data_type, super) VALUES (23,'language',22); |
---|
282 | INSERT INTO core_data_type (id, data_type, super) VALUES (24,'Name',22); |
---|
283 | INSERT INTO core_data_type (id, data_type, super) VALUES (25,'NMTOKEN',22); |
---|
284 | INSERT INTO core_data_type (id, data_type, super) VALUES (26,'NCName',24); |
---|
285 | INSERT INTO core_data_type (id, data_type, super) VALUES (27,'ID',26); |
---|
286 | INSERT INTO core_data_type (id, data_type, super) VALUES (28,'IDREF',26); |
---|
287 | INSERT INTO core_data_type (id, data_type, super) VALUES (29,'ENTITY',26); |
---|
288 | INSERT INTO core_data_type (id, data_type, super) VALUES (30,'decimal',3); |
---|
289 | INSERT INTO core_data_type (id, data_type, super) VALUES (31,'integer',30); |
---|
290 | INSERT INTO core_data_type (id, data_type, super) VALUES (32,'nonPositiveInteger',31); |
---|
291 | INSERT INTO core_data_type (id, data_type, super) VALUES (33,'long',31); |
---|
292 | INSERT INTO core_data_type (id, data_type, super) VALUES (34,'nonNegativeInteger',31); |
---|
293 | INSERT INTO core_data_type (id, data_type, super) VALUES (35,'negativeInteger',32); |
---|
294 | INSERT INTO core_data_type (id, data_type, super) VALUES (36,'int',33); |
---|
295 | INSERT INTO core_data_type (id, data_type, super) VALUES (37,'short',36); |
---|
296 | INSERT INTO core_data_type (id, data_type, super) VALUES (38,'byte',37); |
---|
297 | INSERT INTO core_data_type (id, data_type, super) VALUES (39,'unsignedLong',34); |
---|
298 | INSERT INTO core_data_type (id, data_type, super) VALUES (40,'positiveInteger',34); |
---|
299 | INSERT INTO core_data_type (id, data_type, super) VALUES (41,'unsignedInt',39); |
---|
300 | INSERT INTO core_data_type (id, data_type, super) VALUES (42,'unsignedShort',41); |
---|
301 | INSERT INTO core_data_type (id, data_type, super) VALUES (43,'unsignedByte',42); |
---|
302 | |
---|
303 | SELECT pg_catalog.setval('core_data_type_id_seq', 43, true); |
---|
304 | |
---|
305 | -- the default rule languages |
---|
306 | |
---|
307 | INSERT INTO core_rule_type (rule_type, xml) VALUES('XML Schema facet',true); |
---|
308 | INSERT INTO core_rule_type (rule_type, xml) VALUES('XML Schema regular expression',false); |
---|
309 | INSERT INTO core_rule_type (rule_type, xml) VALUES('Relax NG datatype parameter',true); |
---|
310 | INSERT INTO core_rule_type (rule_type, xml) VALUES('Schematron rule',true); |
---|
311 | INSERT INTO core_rule_type (rule_type, xml) VALUES('Object Constraint Language',false); |
---|
312 | INSERT INTO core_rule_type (rule_type, xml) VALUES('Semantic Web Rule Language',true); |
---|
313 | INSERT INTO core_rule_type (rule_type, xml) VALUES('SCHEMAcat reference',true); |
---|
314 | |
---|
315 | -- the default registration authority |
---|
316 | -- CHANGE: rename to the proper name of the Registration Authority |
---|
317 | |
---|
318 | INSERT INTO core_registration_authority (id, registration_authority) VALUES (0, 'Private'); |
---|
319 | INSERT INTO core_registration_authority ( registration_authority) VALUES ( 'Example Registration Authority'); |
---|
320 | |
---|
321 | -- the default guest user (password: guest) |
---|
322 | |
---|
323 | INSERT INTO core_account(id) VALUES (1); |
---|
324 | INSERT INTO core_owner(id) VALUES (1); |
---|
325 | INSERT INTO core_user(id, login, last_name, password, email, disclaimer, sync) VALUES (1, 'guest', 'Guest', '084e0343a0486ff05530df6c705c8bb4', '', true, false); |
---|
326 | |
---|
327 | -- the default isocat admin (no password, internal use only) |
---|
328 | |
---|
329 | INSERT INTO core_account(id) VALUES (2); |
---|
330 | INSERT INTO core_owner(id) VALUES (2); |
---|
331 | INSERT INTO core_user(id, login, last_name, password, email, type, disclaimer, sync) VALUES (2, 'isocat', 'ISOcat', '', '', 'admin', true, false); |
---|
332 | |
---|
333 | -- the default DCR Board chair (password: password) |
---|
334 | -- CHANGE: replace by the proper details of the DCR Board chair |
---|
335 | |
---|
336 | INSERT INTO core_account(id) VALUES (3); |
---|
337 | INSERT INTO core_owner(id) VALUES (3); |
---|
338 | INSERT INTO core_user(id, login, last_name, password, email, type, disclaimer, sync) VALUES (3, 'chair', 'DCR Board chair', '5f4dcc3b5aa765d61d8327deb882cf99', 'chair@example.com', 'expert', true, false); |
---|
339 | |
---|
340 | -- the DCR Board |
---|
341 | |
---|
342 | INSERT INTO core_account(id) VALUES (4); |
---|
343 | INSERT INTO core_group (id) VALUES (4); |
---|
344 | INSERT INTO core_dcr_board (id) VALUES (4); |
---|
345 | INSERT INTO link_group_members("group", member, "role", status) VALUES (4,3,'chair','accepted'); |
---|
346 | |
---|
347 | -- the default profile |
---|
348 | |
---|
349 | INSERT INTO core_profile (id, name) VALUES (0, 'Private'); |
---|
350 | |
---|
351 | -- an example TDG |
---|
352 | INSERT INTO core_account(id) VALUES (5); |
---|
353 | INSERT INTO core_owner(id) VALUES (5); |
---|
354 | INSERT INTO core_group (id) VALUES (5); |
---|
355 | INSERT INTO core_thematic_domain_group (id,"name",description,"order",status,activity) VALUES (5,'Example','This is an example TDG and profile. To rename them the PostgreSQL database needs to be updated.',1,'example','example'); |
---|
356 | INSERT INTO link_group_members("group", member, "role", status) VALUES (5,3,'chair','accepted'); |
---|
357 | |
---|
358 | -- an example TDG profile |
---|
359 | |
---|
360 | INSERT INTO core_profile (name,tdg) VALUES ('Example',5); |
---|
361 | |
---|
362 | SELECT pg_catalog.setval('core_account_id_seq', 5, true); |
---|