-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb_schema.sql
More file actions
53 lines (49 loc) · 1.44 KB
/
db_schema.sql
File metadata and controls
53 lines (49 loc) · 1.44 KB
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
CREATE TABLE IF NOT EXISTS Schedules (
schedule_id INTEGER PRIMARY KEY,
date_time TEXT NOT NULL UNIQUE
);
CREATE TABLE IF NOT EXISTS Dispatchers (
dispatcher_id INTEGER PRIMARY KEY,
script_name TEXT NOT NULL UNIQUE,
waiting_period TEXT,
config_file_name TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS ForecastGroups (
forecastgroup_id INTEGER PRIMARY KEY,
group_name TEXT NOT NULL,
group_path TEXT NOT NULL,
group_description TEXT,
config_filepath TEXT NOT NULL,
dispatcher_id INTEGER NOT NULL,
FOREIGN KEY(dispatcher_id) REFERENCES Dispatchers
);
CREATE TABLE IF NOT EXISTS Forecasts (
forecast_id INTEGER PRIMARY KEY,
schedule_id INTEGER NOT NULL,
group_id INTEGER NOT NULL,
name TEXT NOT NULL,
filepath TEXT,
meta_filepath TEXT,
waiting_period TEXT,
logfile TEXT,
status TEXT,
FOREIGN KEY(schedule_id) REFERENCES Schedules,
FOREIGN KEY(group_id) REFERENCES ForecastGroups,
UNIQUE(filepath)
);
CREATE TABLE IF NOT EXISTS Evaluations (
evaluation_id INTEGER PRIMARY KEY,
schedule_id INTEGER NOT NULL,
forecast_id INTEGER NOT NULL,
filepath TEXT,
name TEXT,
status TEXT,
runtime_dir TEXT,
creation_datetime TEXT,
catalog_result_filepath TEXT,
catalog_status TEXT,
catalog_creation_datetime TEXT,
FOREIGN KEY(schedule_id) REFERENCES Schedules,
FOREIGN KEY(forecast_id) REFERENCES Forecasts
UNIQUE(forecast_id, name)
);