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
|
--
-- create MMD tables
--
DROP TABLE IF EXISTS session;
CREATE TABLE session (
id TEXT PRIMARY KEY NOT NULL,
email TEXT NOT NULL,
status TEXT,
expires INTEGER NOT NULL,
renewal INTEGER NOT NULL
);
DROP TABLE IF EXISTS user;
CREATE TABLE user (
id TEXT PRIMARY KEY NOT NULL,
firstname TEXT NOT NULL,
lastname TEXT NOT NULL,
callsign TEXT,
email TEXT NOT NULL UNIQUE,
password TEXT NOT NULL,
code TEXT,
regtimeout INTEGER,
status TEXT DEFAULT 'pending'
);
DROP TABLE IF EXISTS location;
CREATE TABLE location (
id TEXT PRIMARY KEY NOT NULL,
longitude REAL,
latitude REAL,
altitude INTEGER,
name TEXT default 'unknown',
is_default TEXT,
user_id TEXT,
FOREIGN KEY (user_id) REFERENCES user (id)
);
DROP TABLE IF EXISTS report;
CREATE TABLE report (
id TEXT PRIMARY KEY NOT NULL,
timestamp INTEGER,
raw TEXT,
audio TEXT,
location_id TEXT,
FOREIGN KEY (location_id) REFERENCES location (id)
);
DROP TABLE IF EXISTS ssps;
CREATE TABLE ssps (
timestamp INTEGER PRIMARY KEY NOT NULL,
longitude REAL,
latitude REAL
);
--
-- EOF
--
|