/*
 * reviseformetacat13_postgres.sql -- Add three columns to xml_access tables
 * and create a new table in Production Metacat
 *
 *      Created: 07/14/2002
 *       Author: Jing Tao
 * Organization: National Center for Ecological Analysis and Synthesis
 *    Copyright: 2000 Regents of the University of California and the
 *               National Center for Ecological Analysis and Synthesis
 *  For Details: http://www.nceas.ucsb.edu/
 *    File Info: '$Id: reviseformetacat13_postgres.sql 1564 2003-04-17 16:49:35Z tao $'
 *
 */


/*
 * Add tow columns - datareplicate and hub to xml_access
 */
ALTER TABLE xml_access ADD subtreeid VARCHAR(32);
ALTER TABLE xml_access ADD startnodeid INT8;
ALTER TABLE xml_access ADD endnodeid INT8;

/*
 * accessSubtree -- table to store access subtree info
 */
CREATE TABLE xml_accesssubtree (
        docid           VARCHAR(250),   -- the document id #
  rev           INT8 default 1, --the revision number of the docume
  controllevel VARCHAR(50), -- the level it control -- document or subtree
  subtreeid VARCHAR(250), -- the subtree id
        startnodeid     INT8,   -- the start node id of access subtree
  endnodeid INT8 -- the end node if of access subtree
);

