tizen 2.3 release
[kernel/api/system-resource.git] / data / traffic_db.sql
1 PRAGMA journal_mode = PERSIST;
2
3 CREATE TABLE IF NOT EXISTS statistics (
4   binpath TEXT,
5   received BIGINT,
6   sent BIGINT,
7   time_stamp BIGINT,
8   iftype INT,
9   is_roaming INT,
10   hw_net_protocol_type INT,
11   ifname TEXT,
12   PRIMARY KEY (binpath, time_stamp, iftype)
13 );
14
15 CREATE INDEX IF NOT EXISTS binpath_st_idx ON statistics(binpath, iftype);
16
17 CREATE TABLE IF NOT EXISTS quotas (
18   binpath TEXT,
19   sent_quota BIGINT,
20   rcv_quota BIGINT,
21   snd_warning_threshold INT,
22   rcv_warning_threshold INT,
23   time_period BIGINT,
24   start_time BIGINT,
25   iftype INT,
26   roaming INT,
27   PRIMARY KEY(binpath, iftype, roaming)
28 );
29
30 CREATE INDEX IF NOT EXISTS binpath_qt_idx ON quotas(binpath, iftype);
31
32 CREATE TABLE IF NOT EXISTS effective_quotas (
33   binpath TEXT,
34   sent_used_quota BIGINT,
35   rcv_used_quota BIGINT,
36   start_time BIGINT,
37   finish_time BIGINT,
38   iftype INT,
39   roaming INT,
40   state INT DEFAULT 0,
41   PRIMARY KEY (binpath, iftype, start_time, finish_time, roaming)
42 );
43
44 CREATE INDEX IF NOT EXISTS binpath_effective_quotas_idx ON effective_quotas(binpath, iftype);
45
46 CREATE TABLE IF NOT EXISTS restrictions (
47   binpath TEXT,
48   rcv_limit BIGINT,
49   send_limit BIGINT,
50   iftype INT,
51   rst_state INT,
52   quota_id INT,
53   roaming INT,
54   PRIMARY KEY (binpath, iftype)
55 );
56
57 CREATE INDEX IF NOT EXISTS binpath_restrictions_idx ON restrictions(binpath, iftype);
58
59 CREATE TABLE IF NOT EXISTS iface_status (
60   update_time BIGINT,
61   iftype INT,
62   ifstatus INT,
63   PRIMARY KEY (update_time)
64 );
65
66 CREATE INDEX IF NOT EXISTS update_tm_if_idx ON iface_status(update_time, iftype, ifstatus);