summaryrefslogtreecommitdiffstats
path: root/upgrades/dbpatches/1.3/postgresql/patch/acknowledges.sql
blob: 15336116cbba18235e70c6fbfaa9ce53bed5fc54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
CREATE TABLE acknowledges_tmp (
	acknowledgeid		bigint DEFAULT '0'	NOT NULL,
	userid		bigint unsigned		DEFAULT '0'	NOT NULL,
	eventid		bigint unsigned		DEFAULT '0'	NOT NULL,
	clock		integer		DEFAULT '0'	NOT NULL,
	message		varchar(255)		DEFAULT ''	NOT NULL,
	PRIMARY KEY (acknowledgeid)
);
CREATE INDEX acknowledges_1 on acknowledges_tmp (userid);
CREATE INDEX acknowledges_2 on acknowledges_tmp (eventid);
CREATE INDEX acknowledges_3 on acknowledges_tmp (clock);

insert into acknowledges_tmp select * from acknowledges;
drop table acknowledges;
alter table acknowledges_tmp rename acknowledges;