This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
install:upgrade:3.1.x-to-3.2.0 [2011/12/22 20:56] 190.111.205.115 [SQL Commands] |
install:upgrade:3.1.x-to-3.2.0 [2011/12/22 20:59] 190.111.205.115 [SQL Commands] |
||
---|---|---|---|
Line 119: | Line 119: | ||
</ | </ | ||
- | This is the translation of the above script for PostgreSQL (tested with 9.1.1) | + | This is the translation of the above script for PostgreSQL (tested with 9.1.1). |
+ | |||
+ | Difference: Instead of adding prefix column, the script renames tag to prefix, and then, creates the new tag column. So that, you don't have to migrate all the values from tag to prefix column. | ||
<code sql> | <code sql> | ||
Line 151: | Line 153: | ||
UPDATE version SET table_version=2 WHERE table_name=' | UPDATE version SET table_version=2 WHERE table_name=' | ||
ALTER TABLE lcr_gw DROP CONSTRAINT lcr_gw_lcr_id_ip_addr_port_hostname_idx; | ALTER TABLE lcr_gw DROP CONSTRAINT lcr_gw_lcr_id_ip_addr_port_hostname_idx; | ||
- | < | ||
- | ALTER TABLE lcr_gw ALTER COLUMN prefix SET DEFAULT NULL; | ||
- | ALTER TABLE lcr_gw ALTER COLUMN tag TYPE VARCHAR(64); | ||
- | ALTER TABLE lcr_gw ALTER COLUMN tag SET DEFAULT NULL;</ | ||
ALTER TABLE lcr_gw RENAME tag TO prefix; | ALTER TABLE lcr_gw RENAME tag TO prefix; | ||
ALTER TABLE lcr_gw ADD tag VARCHAR(64); | ALTER TABLE lcr_gw ADD tag VARCHAR(64); |