summaryrefslogtreecommitdiffstats
path: root/upgrades/dbpatches/1.4/mysql/patch/trends.sql
blob: 8694167acb69b230c2cdb894cafc8576439f9e8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
CREATE TABLE trends_tmp (
	itemid		bigint unsigned		DEFAULT '0'	NOT NULL,
	clock		integer		DEFAULT '0'	NOT NULL,
	num		integer		DEFAULT '0'	NOT NULL,
	value_min		double(16,4)		DEFAULT '0.0000'	NOT NULL,
	value_avg		double(16,4)		DEFAULT '0.0000'	NOT NULL,
	value_max		double(16,4)		DEFAULT '0.0000'	NOT NULL,
	PRIMARY KEY (itemid,clock)
) ENGINE=InnoDB;

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