Revision 544
Added by berkley about 24 years ago
src/xmltables.sql | ||
---|---|---|
29 | 29 |
DROP TRIGGER xml_relation_before_insert; |
30 | 30 |
DROP TRIGGER xml_replication_before_insert; |
31 | 31 |
|
32 |
DROP INDEX xml_relation_index; |
|
33 |
|
|
34 | 32 |
DROP TABLE xml_index; |
35 | 33 |
DROP TABLE xml_catalog; |
36 | 34 |
DROP TABLE xml_access; |
... | ... | |
45 | 43 |
*Replication -- table to store servers that metacat is replicated to |
46 | 44 |
*/ |
47 | 45 |
CREATE TABLE xml_replication ( |
48 |
server VARCHAR2(512), |
|
49 |
last_checked DATE); |
|
46 |
serverid NUMBER(20), |
|
47 |
server VARCHAR2(512), |
|
48 |
last_checked DATE, |
|
49 |
CONSTRAINT xml_replication_pk PRIMARY KEY (serverid) |
|
50 |
); |
|
51 |
|
|
52 |
CREATE SEQUENCE xml_replication_id_seq; |
|
53 |
CREATE TRIGGER xml_replication_before_insert |
|
54 |
BEFORE INSERT ON xml_replication FOR EACH ROW |
|
55 |
BEGIN |
|
56 |
SELECT xml_replication_id_seq.nextval |
|
57 |
INTO :new.serverid |
|
58 |
FROM dual; |
|
59 |
END; |
|
60 |
/ |
|
50 | 61 |
|
51 | 62 |
/* |
52 | 63 |
* Nodes -- table to store XML Nodes (both elements and attributes) |
... | ... | |
90 | 101 |
doctitle VARCHAR2(1000), -- title of document if exists |
91 | 102 |
user_owner VARCHAR2(100), -- the user owned the document |
92 | 103 |
user_updated VARCHAR2(100), -- the user updated the document |
104 |
server_location NUMBER(20), -- the server on which this document resides |
|
93 | 105 |
date_created DATE, |
94 | 106 |
date_updated DATE, |
95 | 107 |
public_access NUMBER(1) DEFAULT 1, -- flag for public access |
96 | 108 |
CONSTRAINT xml_documents_pk PRIMARY KEY (docid), |
109 |
CONSTRAINT xml_documents_rep_fk |
|
110 |
FOREIGN KEY (server_location) REFERENCES xml_replication, |
|
97 | 111 |
CONSTRAINT xml_documents_root_fk |
98 | 112 |
FOREIGN KEY (rootnodeid) REFERENCES xml_nodes |
99 | 113 |
); |
Also available in: Unified diff
added new server_location field to xml_documents with a foreign key to xml_replication.serverid