CREATE TABLE `Wan_stats` ( `id` INT NOT NULL AUTO_INCREMENT , `time`  DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP , `router_id` INT NULL DEFAULT NULL , `interface_id` INT NULL DEFAULT NULL , `in` BIGINT UNSIGNED NOT NULL DEFAULT '0' , `out` BIGINT UNSIGNED NOT NULL DEFAULT '0' , `forward_in` BIGINT UNSIGNED NOT NULL DEFAULT '0' , `forward_out` BIGINT UNSIGNED NOT NULL DEFAULT '0' , PRIMARY KEY (`id`), INDEX `times` (`time`)) ENGINE = InnoDB;
ALTER TABLE `Wan_stats` ADD UNIQUE `main` (`time`, `router_id`, `interface_id`);
