Project

General

Profile

« Previous | Next » 

Revision 2314

Added by sgarg almost 20 years ago

Added code that changes the node column size

View differences:

src/upgrade-db-to-1.4-postgres.sql
86 86
/*
87 87
 * Modify the xml_index.path to the new larger size
88 88
 */
89
ALTER TABLE xml_index MODIFY (path VARCHAR(1000));
90 89

  
90
/* Move data to the table 'temp'*/
91
CREATE TABLE temp AS 
92
	Select * from xml_index;
93
DROP TABLE xml_index;
94

  
95
/* Create the table again */
96
CREATE TABLE xml_index (
97
	nodeid INT8,		-- the unique node id
98
	path VARCHAR(1000),	-- precomputed path through tree
99
	docid VARCHAR(250),	-- index to the document id
100
	doctype VARCHAR(100),	-- public id indicating document type
101
        parentnodeid INT8,     -- id of the parent of the node represented
102
					-- by this row
103
   CONSTRAINT xml_index_pk PRIMARY KEY (nodeid,path),
104
   CONSTRAINT xml_index_nodeid_fk FOREIGN KEY (nodeid) REFERENCES xml_nodes,
105
   CONSTRAINT xml_index_docid_fk 
106
		FOREIGN KEY (docid) REFERENCES xml_documents
107
);
108

  
109
CREATE INDEX xml_index_idx1 ON xml_index (path);
110

  
111
/* Insert data */
112
INSERT INTO xml_index (nodeid, path, docid, doctype, parentnodeid)
113
	SELECT nodeid, path, docid, doctype, parentnodeid
114
		from temp;
115

  
116
/* Drop temp table */
117
DROP TABLE temp;
118

  
91 119
/*
92 120
 * Update the XML_CATALOG table with new entries, and change old ones
93 121
 */

Also available in: Unified diff