db-patch-mysql-fullstat.sql 691 B

12345678910111213141516
  1. CREATE TABLE `User_stats_full` (
  2. `id` int(11) NOT NULL,
  3. `router_id` int(11) DEFAULT 0,
  4. `auth_id` int(11) NOT NULL DEFAULT 0,
  5. `timestamp` datetime NOT NULL DEFAULT current_timestamp(),
  6. `byte_in` bigint(20) NOT NULL DEFAULT 0,
  7. `byte_out` bigint(20) NOT NULL DEFAULT 0,
  8. `pkt_in` int(11) DEFAULT NULL,
  9. `pkt_out` int(11) DEFAULT NULL,
  10. `step` int(11) NOT NULL DEFAULT '600'
  11. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  12. ALTER TABLE `User_stats_full` ADD PRIMARY KEY (`id`), ADD KEY `timestamp` (`timestamp`,`auth_id`,`router_id`);
  13. ALTER TABLE `User_stats_full` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
  14. ALTER TABLE `Traffic_detail` ADD `pkt` INT NOT NULL DEFAULT '0' AFTER `bytes`;