1 |
9435
|
tao
|
SELECT setval('xml_catalog_id_seq', (SELECT max(catalog_id) from xml_catalog));
|
2 |
|
|
|
3 |
8810
|
leinfelder
|
/*
|
4 |
|
|
* Alter the system metadata table to suport seriesId
|
5 |
|
|
*/
|
6 |
9217
|
tao
|
ALTER TABLE systemMetadata ADD COLUMN series_id text, ADD COLUMN media_type text, ADD COLUMN file_name text;
|
7 |
8810
|
leinfelder
|
|
8 |
|
|
/*
|
9 |
9227
|
tao
|
* Create a table used to store the properties for media types. They are part of the system metadata. But a media type
|
10 |
|
|
* can have multiple properties, we have to store them in a separate table. The guids in this table refer
|
11 |
|
|
* the guids in the systemMetadata.
|
12 |
|
|
*/
|
13 |
|
|
CREATE TABLE smMediaTypeProperties (
|
14 |
|
|
guid text, -- id refer to guid in the system metadata table
|
15 |
|
|
name text, -- name of the property
|
16 |
|
|
value text, -- value of the property
|
17 |
|
|
CONSTRAINT smMediaTypeProperties_fk
|
18 |
|
|
FOREIGN KEY (guid) REFERENCES systemMetadata DEFERRABLE
|
19 |
|
|
);
|
20 |
|
|
|
21 |
|
|
/*
|
22 |
9212
|
tao
|
* Add an entry for dataone schema v2
|
23 |
|
|
*/
|
24 |
|
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
25 |
|
|
VALUES ('Schema', 'http://ns.dataone.org/service/types/v2.0', '/schema/dataone/dataoneTypes_v2.0.xsd');
|
26 |
9242
|
tao
|
|
27 |
9212
|
tao
|
/*
|
28 |
9242
|
tao
|
* Add entries for iso119139
|
29 |
|
|
*/
|
30 |
|
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
31 |
|
|
SELECT 'Schema', 'http://www.isotc211.org/2005/gco', '/schema/isotc211/gco/gco.xsd' WHERE NOT EXISTS (SELECT * FROM xml_catalog where public_id='http://www.isotc211.org/2005/gco');
|
32 |
|
|
|
33 |
|
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
34 |
|
|
SELECT 'Schema', 'http://www.isotc211.org/2005/gmd', '/schema/isotc211/gmd/gmd.xsd' WHERE NOT EXISTS (SELECT * FROM xml_catalog where public_id='http://www.isotc211.org/2005/gmd');
|
35 |
|
|
|
36 |
|
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
37 |
|
|
SELECT 'Schema', 'http://www.isotc211.org/2005/gmi', '/schema/isotc211/gmi/gmi.xsd' WHERE NOT EXISTS (SELECT * FROM xml_catalog where public_id='http://www.isotc211.org/2005/gmi');
|
38 |
|
|
|
39 |
|
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
40 |
|
|
SELECT 'Schema', 'http://www.opengis.net/gml/3.2', '/schema/isotc211/gml321/gml.xsd' WHERE NOT EXISTS (SELECT * FROM xml_catalog where public_id='http://www.opengis.net/gml/3.2');
|
41 |
|
|
|
42 |
|
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
43 |
|
|
SELECT 'Schema', 'http://www.opengis.net/gml', '/schema/isotc211/gml311/gml.xsd' WHERE NOT EXISTS (SELECT * FROM xml_catalog where public_id='http://www.opengis.net/gml');
|
44 |
|
|
|
45 |
|
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
46 |
|
|
SELECT 'Schema', 'http://www.isotc211.org/2005/gmx', '/schema/isotc211/gmx/gmx.xsd' WHERE NOT EXISTS (SELECT * FROM xml_catalog where public_id='http://www.isotc211.org/2005/gmx');
|
47 |
|
|
|
48 |
|
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
49 |
|
|
SELECT 'Schema', 'http://www.isotc211.org/2005/gsr', '/schema/isotc211/gsr/gsr.xsd' WHERE NOT EXISTS (SELECT * FROM xml_catalog where public_id='http://www.isotc211.org/2005/gsr');
|
50 |
|
|
|
51 |
|
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
52 |
|
|
SELECT 'Schema', 'http://www.isotc211.org/2005/gss', '/schema/isotc211/gss/gss.xsd' WHERE NOT EXISTS (SELECT * FROM xml_catalog where public_id='http://www.isotc211.org/2005/gss');
|
53 |
|
|
|
54 |
|
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
55 |
|
|
SELECT 'Schema', 'http://www.isotc211.org/2005/gts', '/schema/isotc211/gts/gts.xsd' WHERE NOT EXISTS (SELECT * FROM xml_catalog where public_id='http://www.isotc211.org/2005/gts');
|
56 |
|
|
|
57 |
|
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
58 |
|
|
SELECT 'Schema', 'http://www.isotc211.org/2005/srv', '/schema/isotc211/srv/srv.xsd' WHERE NOT EXISTS (SELECT * FROM xml_catalog where public_id='http://www.isotc211.org/2005/srv');
|
59 |
|
|
|
60 |
|
|
INSERT INTO xml_catalog (entry_type, public_id, system_id)
|
61 |
|
|
SELECT 'Schema', 'http://www.w3.org/1999/xlink', '/schema/isotc211/xlink/xlinks.xsd' WHERE NOT EXISTS (SELECT * FROM xml_catalog where public_id='http://www.w3.org/1999/xlink');
|
62 |
|
|
|
63 |
|
|
/*
|
64 |
8810
|
leinfelder
|
* update the database version
|
65 |
|
|
*/
|
66 |
|
|
UPDATE db_version SET status=0;
|
67 |
|
|
|
68 |
|
|
INSERT INTO db_version (version, status, date_created)
|
69 |
|
|
VALUES ('2.5.0', 1, CURRENT_DATE);
|