summaryrefslogtreecommitdiffstats
path: root/upgrades/dbpatches/1.4/postgresql/patch/trends.sql
blob: 6b7113ed1578ec5b461f2d83fb7500098d3cecd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
CREATE TABLE trends_tmp (
	itemid		bigint DEFAULT '0'	NOT NULL,
	clock		integer		DEFAULT '0'	NOT NULL,
	num		integer		DEFAULT '0'	NOT NULL,
	value_min	numeric(16,4)		DEFAULT '0.0000'	NOT NULL,
	value_avg	numeric(16,4)		DEFAULT '0.0000'	NOT NULL,
	value_max	numeric(16,4)		DEFAULT '0.0000'	NOT NULL,
	PRIMARY KEY (itemid,clock)
) with OIDS;

insert into trends_tmp select * from trends;
drop table trends;
alter table trends_tmp rename to trends;