Revision 4080
Added by daigle about 16 years ago
xmltables.sql | ||
---|---|---|
37 | 37 |
DROP SEQUENCE xml_returnfield_id_seq; |
38 | 38 |
DROP SEQUENCE xml_queryresult_id_seq; |
39 | 39 |
DROP SEQUENCE xml_path_index_id_seq; |
40 |
DROP SEQUENCE db_version_id_seq; |
|
40 | 41 |
|
41 | 42 |
/* Drop triggers are not necessary */ |
42 | 43 |
DROP TRIGGER xml_nodes_before_insert; |
... | ... | |
48 | 49 |
DROP TRIGGER access_log_before_insert; |
49 | 50 |
DROP TRIGGER xml_returnfield_before_insert; |
50 | 51 |
DROP TRIGGER xml_queryresult_before_insert; |
52 |
DROP TRIGGER db_version_before_insert; |
|
51 | 53 |
|
52 | 54 |
|
53 | 55 |
DROP TABLE xml_index; |
... | ... | |
68 | 70 |
DROP TABLE xml_queryresult; |
69 | 71 |
DROP TABLE xml_returnfield; |
70 | 72 |
DROP TABLE xml_path_index; |
73 |
DROP TABLE db_version; |
|
71 | 74 |
|
72 | 75 |
/* |
73 | 76 |
*Replication -- table to store servers that metacat is replicated to |
... | ... | |
547 | 550 |
FOREIGN KEY (harvest_log_id) REFERENCES harvest_log |
548 | 551 |
); |
549 | 552 |
|
553 |
/* |
|
554 |
* db_version -- table to store the version history of this database |
|
555 |
*/ |
|
556 |
CREATE TABLE db_version ( |
|
557 |
db_version_id NUMBER(20), -- the identifier for the version |
|
558 |
version VARCHAR(250), -- the version number |
|
559 |
status NUMBER(20), -- status of the version |
|
560 |
date_created DATE, -- the datetime on which the version was created |
|
561 |
CONSTRAINT db_version_pk PRIMARY KEY (db_version_id) |
|
562 |
); |
|
563 |
|
|
564 |
CREATE SEQUENCE db_version_id_seq; |
|
565 |
CREATE TRIGGER db_version_before_insert |
|
566 |
BEFORE INSERT ON db_version FOR EACH ROW |
|
567 |
BEGIN |
|
568 |
SELECT db_version_id_seq.nextval |
|
569 |
INTO :new.db_version_id |
|
570 |
FROM dual; |
|
571 |
END; |
|
572 |
/ |
|
573 |
|
Also available in: Unified diff
Merge 1.9 changes into Head