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