diff options
Diffstat (limited to 'upgrades/dbpatches/1.3/postgresql/patch/items_applications.sql')
-rw-r--r-- | upgrades/dbpatches/1.3/postgresql/patch/items_applications.sql | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/items_applications.sql b/upgrades/dbpatches/1.3/postgresql/patch/items_applications.sql new file mode 100644 index 00000000..92178eb7 --- /dev/null +++ b/upgrades/dbpatches/1.3/postgresql/patch/items_applications.sql @@ -0,0 +1,23 @@ +CREATE TABLE items_applications_tmp ( + itemappid bigint unsigned NOT NULL auto_increment, + applicationid bigint unsigned DEFAULT '0' NOT NULL, + itemid bigint unsigned DEFAULT '0' NOT NULL, + PRIMARY KEY (itemappid) +) ENGINE=InnoDB; +CREATE INDEX items_applications_1 on items_applications_tmp (applicationid,itemid); + +insert into items_applications_tmp select NULL,applicationid,applicationid from items_applications; +drop table items_applications; +alter table items_applications_tmp rename items_applications; + +CREATE TABLE items_applications_tmp ( + itemappid bigint unsigned DEFAULT '0' NOT NULL, + applicationid bigint unsigned DEFAULT '0' NOT NULL, + itemid bigint unsigned DEFAULT '0' NOT NULL, + PRIMARY KEY (itemappid) +) ENGINE=InnoDB; +CREATE INDEX items_applications_1 on items_applications_tmp (applicationid,itemid); + +insert into items_applications_tmp select * from items_applications; +drop table items_applications; +alter table items_applications_tmp rename items_applications; |