From 55ad58b4e98a2d94f1c5e413d9631e04735b7e7c Mon Sep 17 00:00:00 2001 From: Clint Armstrong Date: Mon, 13 Jul 2015 08:43:23 -0400 Subject: [PATCH] update sql schema to add primary key for pollers --- sql-schema/065.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql-schema/065.sql diff --git a/sql-schema/065.sql b/sql-schema/065.sql new file mode 100644 index 000000000..b201eab9a --- /dev/null +++ b/sql-schema/065.sql @@ -0,0 +1,3 @@ +ALTER TABLE `device_perf` DROP INDEX `id` , ADD INDEX `id` ( `id` ), ADD INDEX ( `device_id` ); +DELETE n1 FROM pollers n1, pollers n2 WHERE n1.last_polled < n2.last_polled and n1.poller_name = n2.poller_name; +ALTER TABLE pollers ADD PRIMARY KEY (poller_name);