-
Notifications
You must be signed in to change notification settings - Fork 1
/
candidate_db_schema.sql
33 lines (33 loc) · 1.02 KB
/
candidate_db_schema.sql
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
CREATE TABLE IF NOT EXISTS candidate (
id INTEGER PRIMARY KEY AUTOINCREMENT,
dm REAL NOT NULL,
snr REAL NOT NULL,
mjd REAL NOT NULL,
boxcar INTEGER NOT NULL,
sample INTEGER NOT NULL
) STRICT;
CREATE TABLE IF NOT EXISTS injection (
id INTEGER PRIMARY KEY AUTOINCREMENT,
mjd REAL NOT NULL,
filename TEXT NOT NULL,
sample INTEGER NOT NULL
) STRICT;
CREATE TABLE IF NOT EXISTS cluster (
id INTEGER PRIMARY KEY AUTOINCREMENT,
centroid INTEGER NOT NULL,
injection INTEGER,
FOREIGN KEY (centroid) REFERENCES candidate (id),
FOREIGN KEY (injection) REFERENCES injection (id)
) STRICT;
CREATE TABLE IF NOT EXISTS cluster_member (
candidate INTEGER PRIMARY KEY,
cluster INTEGER NOT NULL,
FOREIGN KEY (candidate) REFERENCES candidate (id),
FOREIGN KEY (cluster) REFERENCES cluster (id)
) WITHOUT ROWID;
CREATE TABLE IF NOT EXISTS trigger (
id INTEGER PRIMARY KEY AUTOINCREMENT,
cand_name TEXT,
cluster INTEGER NOT NULL,
FOREIGN KEY (cluster) REFERENCES cluster (id)
);