1CREATE TABLE eventlog(
2	user TEXT,
3	realm TEXT,
4	sessionid TEXT COLLATE NOCASE,
5	timestamp TEXT,
6	notes TEXT,
7	dump TEXT,
8	addr TEXT
9);
10
11CREATE TABLE sessions(
12	timestamp TEXT,
13	id TEXT COLLATE NOCASE,
14	user TEXT,
15	realm TEXT,
16	password TEXT,
17	machine_managed BOOLEAN,
18	operation INTEGER,
19	type TEXT,
20	pps TEXT,
21	redirect_uri TEXT,
22	devinfo TEXT,
23	devdetail TEXT,
24	cert TEXT,
25	cert_pem TEXT,
26	mac_addr TEXT,
27	osu_user TEXT,
28	osu_password TEXT,
29	eap_method TEXT,
30	mobile_identifier_hash TEXT,
31	test TEXT
32);
33
34CREATE index sessions_id_index ON sessions(id);
35
36CREATE TABLE osu_config(
37       realm TEXT,
38       field TEXT,
39       value TEXT
40);
41
42CREATE TABLE users(
43	identity TEXT PRIMARY KEY,
44	methods TEXT,
45	password TEXT,
46	machine_managed BOOLEAN,
47	remediation TEXT,
48	phase2 INTEGER,
49	realm TEXT,
50	policy TEXT,
51	devinfo TEXT,
52	devdetail TEXT,
53	pps TEXT,
54	fetch_pps INTEGER,
55	osu_user TEXT,
56	osu_password TEXT,
57	shared INTEGER,
58	cert TEXT,
59	cert_pem TEXT,
60	t_c_timestamp INTEGER,
61	mac_addr TEXT,
62	last_msk TEXT,
63	polupd_done TEXT,
64	subrem TEXT
65);
66
67CREATE TABLE wildcards(
68	identity TEXT PRIMARY KEY,
69	methods TEXT
70);
71
72CREATE TABLE authlog(
73	timestamp TEXT,
74	session TEXT,
75	nas_ip TEXT,
76	username TEXT,
77	note TEXT
78);
79
80CREATE TABLE pending_tc(
81	mac_addr TEXT PRIMARY KEY,
82	identity TEXT
83);
84
85CREATE TABLE current_sessions(
86	mac_addr TEXT PRIMARY KEY,
87	identity TEXT,
88	start_time TEXT,
89	nas TEXT,
90	hs20_t_c_filtering BOOLEAN,
91	waiting_coa_ack BOOLEAN,
92	coa_ack_received BOOLEAN
93);
94
95CREATE TABLE cert_enroll(
96	mac_addr TEXT PRIMARY KEY,
97	user TEXT,
98	realm TEXT,
99	serialnum TEXT
100);
101
102CREATE TABLE sim_provisioning(
103	mobile_identifier_hash TEXT PRIMARY KEY,
104	imsi TEXT,
105	mac_addr TEXT,
106	eap_method TEXT,
107	timestamp TEXT
108);
109