1444598822e62b9ccfa5cbf377b32b974ec60efb
[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   subscriber_id 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   rstn_type INT,
24   roaming INT,
25   subscriber_id TEXT NOT NULL,
26   data_limit BIGINT,
27   data_warn_limit BIGINT
28 );
29
30 CREATE INDEX IF NOT EXISTS restrictions_index ON restrictions (binpath, iftype, ifname);
31
32 CREATE TABLE IF NOT EXISTS counters (
33   restriction_id INTEGER NOT NULL,
34   data_counter BIGINT,
35   PRIMARY KEY (restriction_id)
36 );