Initialize smart traffic control manager package
[platform/core/connectivity/stc-manager.git] / data / traffic_db.sql
1 PRAGMA journal_mode = PERSIST;
2 PRAGMA user_version = 1;
3
4 CREATE TABLE IF NOT EXISTS statistics (
5   id INTEGER PRIMARY KEY AUTOINCREMENT,
6   binpath TEXT NOT NULL,
7   received BIGINT,
8   sent BIGINT,
9   time_stamp BIGINT,
10   iftype INT,
11   is_roaming INT,
12   hw_net_protocol_type INT,
13   ifname TEXT,
14   imsi TEXT,
15   ground INT
16 );
17
18 CREATE TABLE IF NOT EXISTS restrictions (
19   restriction_id INTEGER PRIMARY KEY AUTOINCREMENT,
20   binpath TEXT,
21   iftype INT,
22   ifname TEXT,
23   rst_state INT,
24   roaming INT,
25   imsi TEXT NOT NULL,
26   rcv_limit BIGINT,
27   send_limit BIGINT,
28   rcv_warn_limit BIGINT,
29   send_warn_limit BIGINT
30 );
31
32 CREATE INDEX IF NOT EXISTS restrictions_index ON restrictions (binpath, iftype, ifname);
33
34 CREATE TABLE IF NOT EXISTS counters (
35   restriction_id INTEGER NOT NULL,
36   sent_bytes BIGINT,
37   rcv_bytes BIGINT,
38   PRIMARY KEY (restriction_id)
39 );
40