summaryrefslogtreecommitdiffstats
path: root/upgrades/dbpatches/1.4/mysql/patch/images.sql
blob: d8867e1cf44cb326b03dd8c56bcc9863989a77c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
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;