summaryrefslogtreecommitdiffstats
path: root/upgrades/dbpatches/1.4/postgresql/patch/sysmaps.sql
blob: 975530dbbb88b824eb64d987ecffc886faf4b093 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
CREATE TABLE sysmaps_tmp (
	sysmapid	bigint DEFAULT '0'	NOT NULL,
	name		varchar(128)		DEFAULT ''	NOT NULL,
	width		integer		DEFAULT '0'	NOT NULL,
	height		integer		DEFAULT '0'	NOT NULL,
	backgroundid	bigint DEFAULT '0'	NOT NULL,
	label_type	integer		DEFAULT '0'	NOT NULL,
	label_location	integer		DEFAULT '0'	NOT NULL,
	PRIMARY KEY (sysmapid)
);
CREATE INDEX sysmaps_1 on sysmaps_tmp (name);

insert into sysmaps_tmp select s.sysmapid,s.name,s.width,s.height,i.imageid,s.label_type,s.label_location from sysmaps s,images i where s.background=i.name;
drop table sysmaps;
alter table sysmaps_tmp rename to sysmaps;