Project

General

Profile

« Previous | Next » 

Revision 3334

Added by Jing Tao over 17 years ago

script to change data type of some columns to TEXT

View differences:

src/upgrade-db-to-1.7.1-postgres.sql
1
BEGIN;
2
ALTER TABLE xml_nodes  ADD COLUMN column_new TEXT;
3
UPDATE xml_nodes SET column_new = nodedata;
4
ALTER TABLE xml_nodes DROP COLUMN nodedata;
5
ALTER TABLE xml_nodes RENAME column_new TO nodedata;
6
COMMIT;
7

  
8
BEGIN;
9
ALTER TABLE xml_nodes_revisions ADD COLUMN column_new TEXT;
10
UPDATE xml_nodes_revisions SET column_new = nodedata;
11
ALTER TABLE xml_nodes_revisions DROP COLUMN nodedata;
12
ALTER TABLE xml_nodes_revisions RENAME column_new TO nodedata;
13
COMMIT;
14

  
15
BEGIN;
16
ALTER TABLE xml_queryresult ADD COLUMN column_new TEXT;
17
UPDATE xml_queryresult SET column_new = queryresult_string;
18
ALTER TABLE xml_queryresult DROP COLUMN queryresult_string;
19
ALTER TABLE xml_queryresult RENAME column_new TO queryresult_string;
20
COMMIT;
21

  
22
BEGIN;
23
ALTER TABLE xml_path_index ADD COLUMN column_new TEXT;
24
UPDATE xml_path_index SET column_new = nodedata;
25
ALTER TABLE xml_path_index DROP COLUMN nodedata;
26
ALTER TABLE xml_path_index RENAME column_new TO nodedata;
27
COMMIT;
0 28

  

Also available in: Unified diff