Project

General

Profile

1
/*
2
 * xmlreplicationtables.sql -- Add three columns to xml_access tables
3
 * in Production Metacat
4
 *
5
 *      Created: 07/14/2002
6
 *       Author: Jing Tao
7
 * Organization: National Center for Ecological Analysis and Synthesis
8
 *    Copyright: 2000 Regents of the University of California and the
9
 *               National Center for Ecological Analysis and Synthesis
10
 *  For Details: http://www.nceas.ucsb.edu/
11
 *    File Info: '$Id: reviseformetacat13.sql 1603 2003-04-23 03:53:37Z tao $'
12
 *
13
 */
14

    
15

    
16
/*
17
 * Add three columns to xml_access
18
 */
19
ALTER TABLE xml_access ADD (subtreeid VARCHAR2(32), startnodeid NUMBER(20), endnodeid NUMBER(20) );
20

    
21
/*
22
 * accesssubtree -- table to store access subtree info
23
 */
24
CREATE TABLE xml_accesssubtree (
25
        docid           VARCHAR2(250),  -- the document id #
26
  rev           NUMBER(10) DEFAULT 1, --the revision number of the docume
27
  controllevel VARCHAR2(50), -- the level it control -- document or subtree
28
  subtreeid VARCHAR2(250), -- the subtree id
29
        startnodeid     NUMBER(20),     -- the start node id of access subtree
30
  endnodeid NUMBER(20) -- the end node if of access subtree
31
);
32

    
33
/*
34
 * Drop the constrain in xml_relation table for (subject, relationship, object)
35
 * Add the new constrain in xml_relation table for (docid, subject, relationship, object)
36
 */
37
ALTER TABLE xml_relation DROP CONSTRAINT xml_relation_uk;
38
ALTER TABLE xml_relation ADD  CONSTRAINT xml_relation_uk UNIQUE (docid, subject, relationship, object); 
(5-5/18)