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