Project

General

Profile

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