Project

General

Profile

« Previous | Next » 

Revision 2614

Added by Jing Tao almost 19 years ago

Add some drop command and fix the bug in creating xml_path_index table.

View differences:

xmltables.sql
32 32
DROP SEQUENCE xml_catalog_id_seq;
33 33
DROP SEQUENCE xml_relation_id_seq;
34 34
DROP SEQUENCE xml_replication_id_seq;
35
DROP SEQUENCE xml_documents_id_seq;
36 35
DROP SEQUENCE accession_number_id_seq;
37 36
DROP SEQUENCE access_log_id_seq;
38 37
DROP SEQUENCE xml_returnfield_id_seq;
39 38
DROP SEQUENCE xml_queryresult_id_seq;
39
DROP SEQUENCE xml_path_index_id_seq;
40 40

  
41 41
/* Drop triggers are not necessary */
42 42
DROP TRIGGER xml_nodes_before_insert;
......
55 55
DROP TABLE xml_accesssubtree;
56 56
DROP TABLE xml_revisions;
57 57
DROP TABLE xml_relation;
58
DROP TABLE xml_documents;
58
DROP TABLE xml_documents CASCADE CONSTRAINTS;
59 59
DROP TABLE xml_nodes;
60
DROP TABLE xml_nodes_revision;
60
DROP TABLE xml_nodes_revisions;
61 61
DROP TABLE xml_replication;
62 62
DROP TABLE xml_catalog;
63 63
DROP TABLE accession_number;
......
67 67
DROP TABLE harvest_log;
68 68
DROP TABLE xml_queryresult;
69 69
DROP TABLE xml_returnfield;
70
DROP TABLE xml_path_index;
70 71

  
71 72
/*
72 73
 *Replication -- table to store servers that metacat is replicated to
......
292 293
		FOREIGN KEY (accessfileid) REFERENCES xml_documents
293 294
);
294 295

  
296

  
297

  
295 298
/*
296 299
 * Index of Nodes -- table to store precomputed paths through tree for
297 300
 * quick searching in structured searches
......
316 319

  
317 320

  
318 321
/*
319
 * Index of Paths -- table to store nodes with paths specified by userst in metacat.properties
322
 * Index of Paths - table to store nodes with paths specified by userst in metacat.properties
320 323
 */
321 324
CREATE TABLE xml_path_index (
322 325
        nodeid          NUMBER(20),     -- the unique node id
323 326
        docid           VARCHAR2(250),  -- index to the document id
324 327
        path            VARCHAR2(1000), -- precomputed path through tree
325
	nodedata        VARCHAR2(4000), -- the data for this node (e.g.,
326
                                        -- for TEXT it is the content)
327
        nodedatanumerical NUMBER,       -- the data for this node if
328
                                        -- it is a number
328
	    nodedata        VARCHAR2(4000), -- the data for this node e.g.,
329
        nodedatanumerical NUMBER(20),   -- the data for this node if
329 330
        parentnodeid    NUMBER(20),     -- index of the parent of this node
331
        CONSTRAINT xml_path_index_pk PRIMARY KEY (nodeid),
332
        CONSTRAINT xml_path_index_docid_fk FOREIGN KEY (docid) REFERENCES xml_documents
333
 );                                                                                        
330 334

  
331
   CONSTRAINT xml_path_index_pk PRIMARY KEY (nodeid),
332
   CONSTRAINT xml_path_index_docid_fk
333
                FOREIGN KEY (docid) REFERENCES xml_documents
334
);
335
                                                                                                                                                             
335
/*
336
 * create sequence
337
 */
336 338
CREATE SEQUENCE xml_path_index_id_seq;
337 339
                                                                                                                                                             
338 340
CREATE TRIGGER xml_path_index_before_insert
339
BEFORE INSERT ON xml_path_indexn FOR EACH ROW
341
BEFORE INSERT ON xml_path_index FOR EACH ROW
340 342
BEGIN
341 343
  SELECT xml_path_index_id_seq.nextval
342 344
    INTO :new.relationid
......
353 355
CREATE INDEX xml_path_index_idx3 ON xml_path_index (nodedatanumerical);
354 356

  
355 357

  
358

  
356 359
CREATE TABLE xml_relation (
357 360
	relationid    NUMBER(20) PRIMARY KEY, -- unique id
358 361
	docid         VARCHAR2(250),          -- the docid of the package file

Also available in: Unified diff