summaryrefslogtreecommitdiffstats
path: root/upgrades/dbpatches/1.3/postgresql/patch/images.sql
diff options
context:
space:
mode:
Diffstat (limited to 'upgrades/dbpatches/1.3/postgresql/patch/images.sql')
-rw-r--r--upgrades/dbpatches/1.3/postgresql/patch/images.sql12
1 files changed, 12 insertions, 0 deletions
diff --git a/upgrades/dbpatches/1.3/postgresql/patch/images.sql b/upgrades/dbpatches/1.3/postgresql/patch/images.sql
new file mode 100644
index 00000000..d8867e1c
--- /dev/null
+++ b/upgrades/dbpatches/1.3/postgresql/patch/images.sql
@@ -0,0 +1,12 @@
+CREATE TABLE images_tmp (
+ imageid bigint unsigned DEFAULT '0' NOT NULL,
+ imagetype integer DEFAULT '0' NOT NULL,
+ name varchar(64) DEFAULT '0' NOT NULL,
+ image longblob DEFAULT '' NOT NULL,
+ PRIMARY KEY (imageid)
+) ENGINE=InnoDB;
+CREATE INDEX images_1 on images_tmp (imagetype,name);
+
+insert into images_tmp select * from images;
+drop table images;
+alter table images_tmp rename images;