Revision 6550
Added by ben leinfelder about 13 years ago
src/upgrade-db-to-1.10.0-postgres.sql | ||
---|---|---|
1 |
CREATE TABLE systemMetadata ( |
|
2 |
guid text, -- the globally unique string identifier of the object that the system metadata describes |
|
3 |
date_uploaded TIMESTAMP, -- the date/time the document was first submitted |
|
4 |
rights_holder VARCHAR(250), --the user who has rights to the document, usually the first persons to upload it |
|
5 |
checksum VARCHAR(512), --the checksum of the doc using the given algorithm (see below) |
|
6 |
checksum_algorithm VARCHAR(250), --the algorithm used to calculate the checksum |
|
7 |
origin_member_node VARCHAR(250), --the member node where the document was first uploaded |
|
8 |
authoritive_member_node VARCHAR(250), --the member node that currently controls the document |
|
9 |
date_modified TIMESTAMP, -- the last date/time that the file was changed |
|
10 |
submitter VARCHAR(256), -- the user who originally submitted the doc |
|
11 |
object_format VARCHAR(256), --the format of the object |
|
12 |
size VARCHAR(256), --the size of the object |
|
13 |
replication_allowed boolean, -- replication allowed |
|
14 |
number_replicas INT8, -- the number of replicas allowed |
|
15 |
obsoletes text, -- the identifier that this record obsoletes |
|
16 |
obsoleted_by text, -- the identifier of the record that replaces this record |
|
17 |
CONSTRAINT systemMetadata_pk PRIMARY KEY (guid) |
|
18 |
); |
|
19 |
|
|
20 |
CREATE TABLE systemMetadataReplicationPolicy ( |
|
21 |
guid text, -- the globally unique string identifier of the object that the system metadata describes |
|
22 |
member_node VARCHAR(250), -- replication member node |
|
23 |
policy text, -- the policy (preferred, blocked, etc...TBD) |
|
24 |
CONSTRAINT systemMetadataReplicationPolicy_fk |
|
25 |
FOREIGN KEY (guid) REFERENCES systemMetadata |
|
26 |
); |
|
27 |
|
|
28 |
CREATE TABLE systemMetadataReplicationStatus ( |
|
29 |
guid text, -- the globally unique string identifier of the object that the system metadata describes |
|
30 |
member_node VARCHAR(250), -- replication member node |
|
31 |
status VARCHAR(250), -- replication status |
|
32 |
date_verified TIMESTAMP, -- the date replication was verified |
|
33 |
CONSTRAINT systemMetadataReplicationStatus_fk |
|
34 |
FOREIGN KEY (guid) REFERENCES systemMetadata |
|
35 |
); |
|
36 |
|
|
37 |
CREATE TABLE identifier ( |
|
38 |
guid text, -- the globally unique string identifier |
|
39 |
docid VARCHAR(250), -- the local document id # |
|
40 |
rev INT8, -- the revision part of the local identifier |
|
41 |
CONSTRAINT identifier_pk PRIMARY KEY (guid) |
|
42 |
); |
|
43 |
|
|
44 |
/* |
|
45 |
* add the nodedatadate column to the tables that need it |
|
46 |
*/ |
|
47 |
ALTER TABLE xml_nodes ADD COLUMN nodedatadate TIMESTAMP; |
|
48 |
ALTER TABLE xml_nodes_revisions ADD COLUMN nodedatadate TIMESTAMP; |
|
49 |
ALTER TABLE xml_path_index ADD COLUMN nodedatadate TIMESTAMP; |
|
50 |
CREATE INDEX xml_path_index_idx5 ON xml_path_index (nodedatadate); |
|
51 |
|
|
52 |
/* |
|
53 |
* Replication changes to support DataONE System Metadata replication |
|
54 |
*/ |
|
55 |
ALTER TABLE xml_replication ADD COLUMN systemmetadatareplicate INT8; |
|
56 |
/* |
|
57 |
* Allow guid in xml_access table (for system metadata) |
|
58 |
*/ |
|
59 |
ALTER TABLE xml_access ADD COLUMN guid text; |
|
60 |
|
|
61 |
/** |
|
62 |
* track the user-agent for the request |
|
63 |
*/ |
|
64 |
ALTER TABLE acces_log ADD COLUMN user_agent VARCHAR(512); |
|
65 |
|
|
66 |
/* |
|
67 |
* Register the DataONE schemas |
|
68 |
*/ |
|
69 |
|
|
70 |
INSERT INTO xml_catalog (entry_type, public_id, system_id) |
|
71 |
VALUES ('Schema', 'http://ns.dataone.org/service/types/0.6.4', '/schema/D1_SCHEMA_0_6_4/dataoneTypes.xsd'); |
|
72 |
|
|
73 |
INSERT INTO xml_catalog (entry_type, public_id, system_id) |
|
74 |
VALUES ('Schema', '@eml2_1_1namespace@', '/schema/eml-2.1.1/eml.xsd'); |
|
75 |
/* |
|
76 |
* update the database version |
|
77 |
*/ |
|
78 |
UPDATE db_version SET status=0; |
|
79 |
|
|
80 |
INSERT INTO db_version (version, status, date_created) |
|
81 |
VALUES ('1.10.0', 1, CURRENT_DATE); |
|
82 |
|
src/upgrade-db-to-1.10.0-oracle.sql | ||
---|---|---|
1 |
CREATE TABLE systemMetadata ( |
|
2 |
guid VARCHAR2(2000), -- the globally unique string identifier |
|
3 |
date_uploaded DATE, -- the date/time the document was first submitted |
|
4 |
rights_holder VARCHAR2(250), --the user who has rights to the document, usually the first persons to upload it |
|
5 |
checksum VARCHAR2(512), --the checksum of the doc using the given algorithm (see below) |
|
6 |
checksum_algorithm VARCHAR2(250), --the algorithm used to calculate the checksum |
|
7 |
origin_member_node VARCHAR2(250), --the member node where the document was first uploaded |
|
8 |
authoritive_member_node VARCHAR2(250), --the member node that currently controls the document |
|
9 |
date_modified DATE, -- the last date/time that the file was changed |
|
10 |
submitter VARCHAR2(256), -- the user who originally submitted the doc |
|
11 |
object_format VARCHAR2(256), --the format of the object |
|
12 |
size VARCHAR2(256), --the size of the object |
|
13 |
replication_allowed boolean, -- replication allowed |
|
14 |
number_replicas NUMBER(8), -- the number of replicas allowed |
|
15 |
obsoletes VARCHAR2(2000), -- the identifier of the record that this replaces |
|
16 |
obsoleted_by VARCHAR2(2000), -- the identifier of the record that replaces this record |
|
17 |
CONSTRAINT systemMetadata_pk |
|
18 |
PRIMARY KEY (guid) |
|
19 |
) |
|
20 |
|
|
21 |
CREATE TABLE systemMetadataReplicationPolicy ( |
|
22 |
guid VARCHAR2(2000), -- the globally unique string identifier of the object that the system metadata describes |
|
23 |
member_node VARCHAR(250), -- replication member node |
|
24 |
policy VARCHAR2(2000), -- the policy (preferred, blocked, etc...TBD) |
|
25 |
CONSTRAINT systemMetadataReplicationPolicy_fk |
|
26 |
FOREIGN KEY (guid) REFERENCES systemMetadata |
|
27 |
); |
|
28 |
|
|
29 |
CREATE TABLE systemMetadataReplicationStatus ( |
|
30 |
guid VARCHAR2(2000), -- the globally unique string identifier of the object that the system metadata describes |
|
31 |
member_node VARCHAR(250), -- replication member node |
|
32 |
status VARCHAR(250), -- replication status |
|
33 |
date_verified DATE, -- the date replication was verified |
|
34 |
CONSTRAINT systemMetadataReplicationStatus_fk |
|
35 |
FOREIGN KEY (guid) REFERENCES systemMetadata |
|
36 |
); |
|
37 |
|
|
38 |
CREATE TABLE identifier ( |
|
39 |
guid VARCHAR2(2000), -- the globally unique string identifier |
|
40 |
docid VARCHAR2(250), -- the local document id # |
|
41 |
rev NUMBER(8) -- the revision part of the local identifier |
|
42 |
); |
|
43 |
|
|
44 |
/* |
|
45 |
* Replication changes to support DataONE System Metadata replication |
|
46 |
*/ |
|
47 |
ALTER TABLE xml_replication ADD COLUMN systemmetadatareplicate NUMBER(1); |
|
48 |
/* |
|
49 |
* Allow guid in xml_access table (for system metadata) |
|
50 |
*/ |
|
51 |
ALTER TABLE xml_access ADD COLUMN guid VARCHAR2(2000); |
|
52 |
|
|
53 |
/** |
|
54 |
* track the user-agent for the request |
|
55 |
*/ |
|
56 |
ALTER TABLE acces_log ADD COLUMN user_agent VARCHAR2(512); |
|
57 |
|
|
58 |
/* |
|
59 |
* add the nodedatadate column to xml_nodes |
|
60 |
* TODO: load the data into it (java?) |
|
61 |
*/ |
|
62 |
ALTER TABLE xml_nodes ADD COLUMN nodedatadate TIMESTAMP; |
|
63 |
ALTER TABLE xml_nodes_revisions ADD COLUMN nodedatadate TIMESTAMP; |
|
64 |
ALTER TABLE xml_path_index ADD COLUMN nodedatadate TIMESTAMP; |
|
65 |
CREATE INDEX xml_path_index_idx4 ON xml_path_index (nodedatadate); |
|
66 |
|
|
67 |
/* |
|
68 |
* Register the DataONE schemas |
|
69 |
*/ |
|
70 |
INSERT INTO xml_catalog (entry_type, public_id, system_id) |
|
71 |
VALUES ('Schema', 'http://ns.dataone.org/service/types/0.6.4', '/schema/D1_SCHEMA_0_6_4/dataoneTypes.xsd'); |
|
72 |
|
|
73 |
INSERT INTO xml_catalog (entry_type, public_id, system_id) |
|
74 |
VALUES ('Schema', '@eml2_1_1namespace@', '/schema/eml-2.1.1/eml.xsd'); |
|
75 |
|
|
76 |
/* |
|
77 |
* update the database version |
|
78 |
*/ |
|
79 |
UPDATE db_version SET status=0; |
|
80 |
|
|
81 |
INSERT INTO db_version (version, status, date_created) |
|
82 |
VALUES ('1.10.0', 1, CURRENT_DATE); |
src/edu/ucsb/nceas/metacat/admin/upgrade/Upgrade1_10_0.java | ||
---|---|---|
1 |
package edu.ucsb.nceas.metacat.admin.upgrade; |
|
2 |
/** |
|
3 |
* '$RCSfile$' |
|
4 |
* Purpose: A Class for upgrading the database to version 1.5 |
|
5 |
* Copyright: 2000 Regents of the University of California and the |
|
6 |
* National Center for Ecological Analysis and Synthesis |
|
7 |
* Authors: Saurabh Garg |
|
8 |
* |
|
9 |
* '$Author$' |
|
10 |
* '$Date$' |
|
11 |
* '$Revision$' |
|
12 |
* |
|
13 |
* This program is free software; you can redistribute it and/or modify |
|
14 |
* it under the terms of the GNU General Public License as published by |
|
15 |
* the Free Software Foundation; either version 2 of the License, or |
|
16 |
* (at your option) any later version. |
|
17 |
* |
|
18 |
* This program is distributed in the hope that it will be useful, |
|
19 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
20 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
21 |
* GNU General Public License for more details. |
|
22 |
* |
|
23 |
* You should have received a copy of the GNU General Public License |
|
24 |
* along with this program; if not, write to the Free Software |
|
25 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
26 |
*/ |
|
27 |
|
|
28 |
|
|
29 |
import edu.ucsb.nceas.metacat.admin.AdminException; |
|
30 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
|
31 |
import edu.ucsb.nceas.utilities.SortedProperties; |
|
32 |
|
|
33 |
public class Upgrade1_10_0 implements UpgradeUtilityInterface { |
|
34 |
|
|
35 |
public boolean upgrade() throws AdminException { |
|
36 |
boolean success = true; |
|
37 |
|
|
38 |
// node data datetime |
|
39 |
UpgradeNodeDataDatetime dateTimeUpgrade = new UpgradeNodeDataDatetime(); |
|
40 |
success = dateTimeUpgrade.upgrade(); |
|
41 |
|
|
42 |
// dataone system metadata generation |
|
43 |
|
|
44 |
|
|
45 |
return success; |
|
46 |
} |
|
47 |
|
|
48 |
public static void main(String [] ags){ |
|
49 |
|
|
50 |
try { |
|
51 |
// set up the properties based on the test/deployed configuration of the workspace |
|
52 |
SortedProperties testProperties = |
|
53 |
new SortedProperties("test/test.properties"); |
|
54 |
testProperties.load(); |
|
55 |
String metacatContextDir = testProperties.getProperty("metacat.contextDir"); |
|
56 |
PropertyService.getInstance(metacatContextDir + "/WEB-INF"); |
|
57 |
// now run it |
|
58 |
Upgrade1_10_0 upgrader = new Upgrade1_10_0(); |
|
59 |
upgrader.upgrade(); |
|
60 |
|
|
61 |
} catch (Exception ex) { |
|
62 |
System.out.println("Exception:" + ex.getMessage()); |
|
63 |
ex.printStackTrace(); |
|
64 |
} |
|
65 |
} |
|
66 |
} |
|
67 | 0 |
lib/metacat.properties | ||
---|---|---|
70 | 70 |
database.upgradeVersion.1.9.3=upgrade-db-to-1.9.3 |
71 | 71 |
database.upgradeVersion.1.9.4=upgrade-db-to-1.9.4 |
72 | 72 |
database.upgradeVersion.1.9.5=upgrade-db-to-1.9.5 |
73 |
database.upgradeVersion.1.10.0=upgrade-db-to-1.10.0
|
|
73 |
database.upgradeVersion.2.0.0=upgrade-db-to-2.0.0
|
|
74 | 74 |
## for running java-based utilities |
75 | 75 |
database.upgradeUtility.1.5.0=edu.ucsb.nceas.metacat.admin.upgrade.Upgrade1_5_0 |
76 |
database.upgradeUtility.1.10.0=edu.ucsb.nceas.metacat.admin.upgrade.Upgrade1_10_0
|
|
76 |
database.upgradeUtility.2.0.0=edu.ucsb.nceas.metacat.admin.upgrade.Upgrade2_0_0
|
|
77 | 77 |
database.initialConnections=5 |
78 | 78 |
database.incrementConnections=5 |
79 | 79 |
database.maximumConnections=200 |
src/upgrade-db-to-2.0.0-oracle.sql | ||
---|---|---|
1 |
CREATE TABLE systemMetadata ( |
|
2 |
guid VARCHAR2(2000), -- the globally unique string identifier |
|
3 |
date_uploaded DATE, -- the date/time the document was first submitted |
|
4 |
rights_holder VARCHAR2(250), --the user who has rights to the document, usually the first persons to upload it |
|
5 |
checksum VARCHAR2(512), --the checksum of the doc using the given algorithm (see below) |
|
6 |
checksum_algorithm VARCHAR2(250), --the algorithm used to calculate the checksum |
|
7 |
origin_member_node VARCHAR2(250), --the member node where the document was first uploaded |
|
8 |
authoritive_member_node VARCHAR2(250), --the member node that currently controls the document |
|
9 |
date_modified DATE, -- the last date/time that the file was changed |
|
10 |
submitter VARCHAR2(256), -- the user who originally submitted the doc |
|
11 |
object_format VARCHAR2(256), --the format of the object |
|
12 |
size VARCHAR2(256), --the size of the object |
|
13 |
replication_allowed boolean, -- replication allowed |
|
14 |
number_replicas NUMBER(8), -- the number of replicas allowed |
|
15 |
obsoletes VARCHAR2(2000), -- the identifier of the record that this replaces |
|
16 |
obsoleted_by VARCHAR2(2000), -- the identifier of the record that replaces this record |
|
17 |
CONSTRAINT systemMetadata_pk |
|
18 |
PRIMARY KEY (guid) |
|
19 |
) |
|
20 |
|
|
21 |
CREATE TABLE systemMetadataReplicationPolicy ( |
|
22 |
guid VARCHAR2(2000), -- the globally unique string identifier of the object that the system metadata describes |
|
23 |
member_node VARCHAR(250), -- replication member node |
|
24 |
policy VARCHAR2(2000), -- the policy (preferred, blocked, etc...TBD) |
|
25 |
CONSTRAINT systemMetadataReplicationPolicy_fk |
|
26 |
FOREIGN KEY (guid) REFERENCES systemMetadata |
|
27 |
); |
|
28 |
|
|
29 |
CREATE TABLE systemMetadataReplicationStatus ( |
|
30 |
guid VARCHAR2(2000), -- the globally unique string identifier of the object that the system metadata describes |
|
31 |
member_node VARCHAR(250), -- replication member node |
|
32 |
status VARCHAR(250), -- replication status |
|
33 |
date_verified DATE, -- the date replication was verified |
|
34 |
CONSTRAINT systemMetadataReplicationStatus_fk |
|
35 |
FOREIGN KEY (guid) REFERENCES systemMetadata |
|
36 |
); |
|
37 |
|
|
38 |
CREATE TABLE identifier ( |
|
39 |
guid VARCHAR2(2000), -- the globally unique string identifier |
|
40 |
docid VARCHAR2(250), -- the local document id # |
|
41 |
rev NUMBER(8) -- the revision part of the local identifier |
|
42 |
); |
|
43 |
|
|
44 |
/* |
|
45 |
* Replication changes to support DataONE System Metadata replication |
|
46 |
*/ |
|
47 |
ALTER TABLE xml_replication ADD COLUMN systemmetadatareplicate NUMBER(1); |
|
48 |
/* |
|
49 |
* Allow guid in xml_access table (for system metadata) |
|
50 |
*/ |
|
51 |
ALTER TABLE xml_access ADD COLUMN guid VARCHAR2(2000); |
|
52 |
|
|
53 |
/** |
|
54 |
* track the user-agent for the request |
|
55 |
*/ |
|
56 |
ALTER TABLE acces_log ADD COLUMN user_agent VARCHAR2(512); |
|
57 |
|
|
58 |
/* |
|
59 |
* add the nodedatadate column to xml_nodes |
|
60 |
* TODO: load the data into it (java?) |
|
61 |
*/ |
|
62 |
ALTER TABLE xml_nodes ADD COLUMN nodedatadate TIMESTAMP; |
|
63 |
ALTER TABLE xml_nodes_revisions ADD COLUMN nodedatadate TIMESTAMP; |
|
64 |
ALTER TABLE xml_path_index ADD COLUMN nodedatadate TIMESTAMP; |
|
65 |
CREATE INDEX xml_path_index_idx4 ON xml_path_index (nodedatadate); |
|
66 |
|
|
67 |
/* |
|
68 |
* Register the DataONE schemas |
|
69 |
*/ |
|
70 |
INSERT INTO xml_catalog (entry_type, public_id, system_id) |
|
71 |
VALUES ('Schema', 'http://ns.dataone.org/service/types/0.6.4', '/schema/D1_SCHEMA_0_6_4/dataoneTypes.xsd'); |
|
72 |
|
|
73 |
INSERT INTO xml_catalog (entry_type, public_id, system_id) |
|
74 |
VALUES ('Schema', '@eml2_1_1namespace@', '/schema/eml-2.1.1/eml.xsd'); |
|
75 |
|
|
76 |
/* |
|
77 |
* update the database version |
|
78 |
*/ |
|
79 |
UPDATE db_version SET status=0; |
|
80 |
|
|
81 |
INSERT INTO db_version (version, status, date_created) |
|
82 |
VALUES ('2.0.0', 1, CURRENT_DATE); |
src/loaddtdschema-oracle.sql | ||
---|---|---|
54 | 54 |
INSERT INTO xml_catalog (entry_type, public_id, system_id) |
55 | 55 |
VALUES ('Schema', 'http://ns.dataone.org/service/types/0.6.4', '/schema/D1_SCHEMA_0_6_4/dataoneTypes.xsd'); |
56 | 56 |
INSERT INTO db_version (version, status, date_created) |
57 |
VALUES ('1.10.0',1,CURRENT_DATE); |
|
57 |
VALUES ('2.0.0',1,CURRENT_DATE); |
src/upgrade-db-to-2.0.0-postgres.sql | ||
---|---|---|
1 |
CREATE TABLE systemMetadata ( |
|
2 |
guid text, -- the globally unique string identifier of the object that the system metadata describes |
|
3 |
date_uploaded TIMESTAMP, -- the date/time the document was first submitted |
|
4 |
rights_holder VARCHAR(250), --the user who has rights to the document, usually the first persons to upload it |
|
5 |
checksum VARCHAR(512), --the checksum of the doc using the given algorithm (see below) |
|
6 |
checksum_algorithm VARCHAR(250), --the algorithm used to calculate the checksum |
|
7 |
origin_member_node VARCHAR(250), --the member node where the document was first uploaded |
|
8 |
authoritive_member_node VARCHAR(250), --the member node that currently controls the document |
|
9 |
date_modified TIMESTAMP, -- the last date/time that the file was changed |
|
10 |
submitter VARCHAR(256), -- the user who originally submitted the doc |
|
11 |
object_format VARCHAR(256), --the format of the object |
|
12 |
size VARCHAR(256), --the size of the object |
|
13 |
replication_allowed boolean, -- replication allowed |
|
14 |
number_replicas INT8, -- the number of replicas allowed |
|
15 |
obsoletes text, -- the identifier that this record obsoletes |
|
16 |
obsoleted_by text, -- the identifier of the record that replaces this record |
|
17 |
CONSTRAINT systemMetadata_pk PRIMARY KEY (guid) |
|
18 |
); |
|
19 |
|
|
20 |
CREATE TABLE systemMetadataReplicationPolicy ( |
|
21 |
guid text, -- the globally unique string identifier of the object that the system metadata describes |
|
22 |
member_node VARCHAR(250), -- replication member node |
|
23 |
policy text, -- the policy (preferred, blocked, etc...TBD) |
|
24 |
CONSTRAINT systemMetadataReplicationPolicy_fk |
|
25 |
FOREIGN KEY (guid) REFERENCES systemMetadata |
|
26 |
); |
|
27 |
|
|
28 |
CREATE TABLE systemMetadataReplicationStatus ( |
|
29 |
guid text, -- the globally unique string identifier of the object that the system metadata describes |
|
30 |
member_node VARCHAR(250), -- replication member node |
|
31 |
status VARCHAR(250), -- replication status |
|
32 |
date_verified TIMESTAMP, -- the date replication was verified |
|
33 |
CONSTRAINT systemMetadataReplicationStatus_fk |
|
34 |
FOREIGN KEY (guid) REFERENCES systemMetadata |
|
35 |
); |
|
36 |
|
|
37 |
CREATE TABLE identifier ( |
|
38 |
guid text, -- the globally unique string identifier |
|
39 |
docid VARCHAR(250), -- the local document id # |
|
40 |
rev INT8, -- the revision part of the local identifier |
|
41 |
CONSTRAINT identifier_pk PRIMARY KEY (guid) |
|
42 |
); |
|
43 |
|
|
44 |
/* |
|
45 |
* add the nodedatadate column to the tables that need it |
|
46 |
*/ |
|
47 |
ALTER TABLE xml_nodes ADD COLUMN nodedatadate TIMESTAMP; |
|
48 |
ALTER TABLE xml_nodes_revisions ADD COLUMN nodedatadate TIMESTAMP; |
|
49 |
ALTER TABLE xml_path_index ADD COLUMN nodedatadate TIMESTAMP; |
|
50 |
CREATE INDEX xml_path_index_idx5 ON xml_path_index (nodedatadate); |
|
51 |
|
|
52 |
/* |
|
53 |
* Replication changes to support DataONE System Metadata replication |
|
54 |
*/ |
|
55 |
ALTER TABLE xml_replication ADD COLUMN systemmetadatareplicate INT8; |
|
56 |
/* |
|
57 |
* Allow guid in xml_access table (for system metadata) |
|
58 |
*/ |
|
59 |
ALTER TABLE xml_access ADD COLUMN guid text; |
|
60 |
|
|
61 |
/** |
|
62 |
* track the user-agent for the request |
|
63 |
*/ |
|
64 |
ALTER TABLE acces_log ADD COLUMN user_agent VARCHAR(512); |
|
65 |
|
|
66 |
/* |
|
67 |
* Register the DataONE schemas |
|
68 |
*/ |
|
69 |
|
|
70 |
INSERT INTO xml_catalog (entry_type, public_id, system_id) |
|
71 |
VALUES ('Schema', 'http://ns.dataone.org/service/types/0.6.4', '/schema/D1_SCHEMA_0_6_4/dataoneTypes.xsd'); |
|
72 |
|
|
73 |
INSERT INTO xml_catalog (entry_type, public_id, system_id) |
|
74 |
VALUES ('Schema', '@eml2_1_1namespace@', '/schema/eml-2.1.1/eml.xsd'); |
|
75 |
/* |
|
76 |
* update the database version |
|
77 |
*/ |
|
78 |
UPDATE db_version SET status=0; |
|
79 |
|
|
80 |
INSERT INTO db_version (version, status, date_created) |
|
81 |
VALUES ('2.0.0', 1, CURRENT_DATE); |
|
82 |
|
src/loaddtdschema-postgres.sql | ||
---|---|---|
54 | 54 |
INSERT INTO xml_catalog (entry_type, public_id, system_id) |
55 | 55 |
VALUES ('Schema', 'http://ns.dataone.org/service/types/0.6.4', '/schema/D1_SCHEMA_0_6_4/dataoneTypes.xsd'); |
56 | 56 |
INSERT INTO db_version (version, status, date_created) |
57 |
VALUES ('1.10.0',1,CURRENT_DATE); |
|
57 |
VALUES ('2.0.0',1,CURRENT_DATE); |
src/edu/ucsb/nceas/metacat/admin/upgrade/UpgradeNodeDataDatetime.java | ||
---|---|---|
131 | 131 |
sqlca.close(); |
132 | 132 |
} catch (Exception e) { |
133 | 133 |
e.printStackTrace(); |
134 |
throw new AdminException("Error upgrading system to 1.10.0: " + e.getMessage());
|
|
134 |
throw new AdminException("Error upgrading system to 2.0.0: " + e.getMessage());
|
|
135 | 135 |
} |
136 | 136 |
return true; |
137 | 137 |
} |
src/edu/ucsb/nceas/metacat/admin/upgrade/Upgrade2_0_0.java | ||
---|---|---|
1 |
package edu.ucsb.nceas.metacat.admin.upgrade; |
|
2 |
/** |
|
3 |
* '$RCSfile$' |
|
4 |
* Purpose: A Class for upgrading the database to version 1.5 |
|
5 |
* Copyright: 2000 Regents of the University of California and the |
|
6 |
* National Center for Ecological Analysis and Synthesis |
|
7 |
* Authors: Saurabh Garg |
|
8 |
* |
|
9 |
* '$Author$' |
|
10 |
* '$Date$' |
|
11 |
* '$Revision$' |
|
12 |
* |
|
13 |
* This program is free software; you can redistribute it and/or modify |
|
14 |
* it under the terms of the GNU General Public License as published by |
|
15 |
* the Free Software Foundation; either version 2 of the License, or |
|
16 |
* (at your option) any later version. |
|
17 |
* |
|
18 |
* This program is distributed in the hope that it will be useful, |
|
19 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
20 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
21 |
* GNU General Public License for more details. |
|
22 |
* |
|
23 |
* You should have received a copy of the GNU General Public License |
|
24 |
* along with this program; if not, write to the Free Software |
|
25 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
26 |
*/ |
|
27 |
|
|
28 |
|
|
29 |
import edu.ucsb.nceas.metacat.admin.AdminException; |
|
30 |
import edu.ucsb.nceas.metacat.properties.PropertyService; |
|
31 |
import edu.ucsb.nceas.utilities.SortedProperties; |
|
32 |
|
|
33 |
public class Upgrade2_0_0 implements UpgradeUtilityInterface { |
|
34 |
|
|
35 |
public boolean upgrade() throws AdminException { |
|
36 |
boolean success = true; |
|
37 |
|
|
38 |
// node data datetime |
|
39 |
UpgradeNodeDataDatetime dateTimeUpgrade = new UpgradeNodeDataDatetime(); |
|
40 |
success = dateTimeUpgrade.upgrade(); |
|
41 |
|
|
42 |
// dataone system metadata generation |
|
43 |
|
|
44 |
|
|
45 |
return success; |
|
46 |
} |
|
47 |
|
|
48 |
public static void main(String [] ags){ |
|
49 |
|
|
50 |
try { |
|
51 |
// set up the properties based on the test/deployed configuration of the workspace |
|
52 |
SortedProperties testProperties = |
|
53 |
new SortedProperties("test/test.properties"); |
|
54 |
testProperties.load(); |
|
55 |
String metacatContextDir = testProperties.getProperty("metacat.contextDir"); |
|
56 |
PropertyService.getInstance(metacatContextDir + "/WEB-INF"); |
|
57 |
// now run it |
|
58 |
Upgrade2_0_0 upgrader = new Upgrade2_0_0(); |
|
59 |
upgrader.upgrade(); |
|
60 |
|
|
61 |
} catch (Exception ex) { |
|
62 |
System.out.println("Exception:" + ex.getMessage()); |
|
63 |
ex.printStackTrace(); |
|
64 |
} |
|
65 |
} |
|
66 |
} |
|
0 | 67 |
Also available in: Unified diff
change upgrade scripts/routines to use 2.0.0 version number instead of 1.10.0