summaryrefslogtreecommitdiffstats
path: root/upgrades/dbpatches/1.3/postgresql/patch/trends.sql
blob: 7e10db00cef496c3a2d5eb901a6d519403391b13 (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)
);

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