-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathcreate_db_tables.sql
58 lines (51 loc) · 2.05 KB
/
create_db_tables.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
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
-- ...................................................
-- MySQL Table Definition Script:
-- These tables must be created and the DSN
-- information added to db-config.json
-- before you can run the Node server or track jobs.
--
-- If you're upgrading to FlowTracker 0.8.x
-- you should create these tables before upgrading
-- the tracker jar or Node app.
--
-- NOTE: if you need to change the names of these
-- tables, do so at creation time, then set
-- the table name aliases in db-config.json
-- (See the README.md and UPGRADE.md docs)
-- ...................................................
CREATE TABLE `cascading_job_flows_new` (
`flow_id` char(32) NOT NULL,
`flow_name` char(96) NOT NULL,
`flow_status` char(32) NOT NULL,
`flow_json` text NOT NULL,
`update_date` int(11) unsigned NOT NULL,
`create_date` int(11) unsigned NOT NULL,
PRIMARY KEY (`flow_id`)
);
CREATE INDEX idx_create_date_cascading_job_flows_new ON cascading_job_flows_new (create_date);
CREATE INDEX idx_update_date_flow_status_cascading_job_flows_new ON cascading_job_flows_new (update_date, flow_status);
CREATE INDEX idx_flow_status_cascading_job_flows_new ON cascading_job_flows_new (flow_status);
CREATE TABLE `cascading_job_steps_new` (
`step_id` char(32) NOT NULL,
`flow_id` char(32) NOT NULL,
`step_json` text NOT NULL,
`create_date` int(11) unsigned NOT NULL,
`update_date` int(11) unsigned NOT NULL,
PRIMARY KEY (`step_id`)
);
CREATE INDEX idx_flow_id_cascading_job_steps_new ON cascading_job_steps_new (flow_id);
CREATE TABLE `cascading_job_edges_new` (
`flow_id` char(32) NOT NULL,
`src_stage` int(11) NOT NULL,
`dest_stage` int(11) NOT NULL,
`update_date` int(11) unsigned NOT NULL,
`create_date` int(11) unsigned NOT NULL,
PRIMARY KEY (`flow_id`, `src_stage`, `dest_stage`)
);
CREATE INDEX idx_flow_id_cascading_job_edges_new ON cascading_job_edges_new (flow_id);
CREATE TABLE `cascading_job_aggregated_new` (
`flow_id` char(32) NOT NULL,
`agg_json` text NOT NULL,
`epoch_ms` bigint(22) unsigned NOT NULL,
PRIMARY KEY (`epoch_ms`, `flow_id`)
);