-
Notifications
You must be signed in to change notification settings - Fork 0
/
ip-accounting.sql
executable file
·72 lines (61 loc) · 1.98 KB
/
ip-accounting.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
-- phpMyAdmin SQL Dump
-- version 3.4.11.1deb2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 08, 2013 at 11:29 AM
-- Server version: 5.5.31
-- PHP Version: 5.4.4-14+deb7u2
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `ipaccounting`
--
-- --------------------------------------------------------
--
-- Table structure for table `hours`
--
CREATE TABLE IF NOT EXISTS `hours` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`uploaded` int(10) unsigned NOT NULL,
`downloaded` int(10) unsigned NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `hourly_user` (`date`,`user_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `raw_hours`
--
CREATE TABLE IF NOT EXISTS `raw_hours` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`date` int(10) unsigned NOT NULL,
`src_addr` varchar(39) NOT NULL,
`dst_addr` varchar(39) NOT NULL,
`bytes` int(10) unsigned NOT NULL,
`packets` int(10) unsigned NOT NULL,
`src_user_name` varchar(32) DEFAULT NULL,
`dst_user_name` varchar(32) DEFAULT NULL,
`router_hostname` varchar(255) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL,
`cn` varchar(255) NOT NULL,
`lastip` varchar(39) NOT NULL,
`firstseen` int(10) unsigned NOT NULL,
`lastseen` int(10) unsigned NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;