Project

General

Profile

« Previous | Next » 

Revision 2661

Added by Jing Tao about 19 years ago

Copy the code to generate xml_path_index from xmltables.sql. xmltables.sql is working, so it may fix the bug.

View differences:

src/upgrade-db-to-1.6.sql
23 23
 */
24 24
 
25 25

  
26
/**
27
 * Create the xml_path_index table
26
/*
27
 * Index of Paths - table to store nodes with paths specified by userst in metacat.properties
28 28
 */
29

  
30
CREATE SEQUENCE xml_path_index_id_seq;
31 29
CREATE TABLE xml_path_index (
32 30
        nodeid          NUMBER(20),     -- the unique node id
33 31
        docid           VARCHAR2(250),  -- index to the document id
34 32
        path            VARCHAR2(1000), -- precomputed path through tree
35
	nodedata        VARCHAR2(4000), -- the data for this node (e.g.,
36
                                        -- for TEXT it is the content)
37
        nodedatanumerical NUMBER,       -- the data for this node if
38
                                        -- it is a number
33
	    nodedata        VARCHAR2(4000), -- the data for this node e.g.,
34
        nodedatanumerical NUMBER(20),   -- the data for this node if
39 35
        parentnodeid    NUMBER(20),     -- index of the parent of this node
36
        CONSTRAINT xml_path_index_pk PRIMARY KEY (nodeid),
37
        CONSTRAINT xml_path_index_docid_fk FOREIGN KEY (docid) REFERENCES xml_documents
38
 );                                                                                        
40 39

  
41
   CONSTRAINT xml_path_index_pk PRIMARY KEY (nodeid),
42
   CONSTRAINT xml_path_index_docid_fk
43
                FOREIGN KEY (docid) REFERENCES xml_documents
44
);
45
                                                                                                                                                             
40

  
41
/*
42
 * create sequence an trigger
43
 */
44
CREATE SEQUENCE xml_path_index_id_seq;                                                                                                                                                             
46 45
CREATE TRIGGER xml_path_index_before_insert
47 46
BEFORE INSERT ON xml_path_index FOR EACH ROW
48 47
BEGIN
......
53 52
/
54 53

  
55 54

  
56
/*
55
/**
57 56
 * Index of the path, nodedata, nodedatanumerical in xml_path_index
58 57
 */
59 58
CREATE INDEX xml_path_index_idx1 ON xml_path_index (path);

Also available in: Unified diff