· 5 years ago · Jul 24, 2020, 02:24 PM
1create table if not exists cdl_test_lists
2(
3 id uuid primary key,
4 created_by text,
5 created_at timestamp,
6 modified_by text,
7 modified_at timestamp,
8 run_date timestamp,
9 pick_date timestamp,
10 run_number integer,
11 shift text,
12 to_test integer,
13 generated_count integer,
14 test_location text
15);
16
17create table if not exists employee
18(
19 id uuid primary key,
20 created_by text,
21 created_at timestamp,
22 modified_by text,
23 modified_at timestamp,
24 name text,
25 reference_number text
26);
27
28create table if not exists cdl_test_list_employees
29(
30 id uuid primary key,
31 cdl_test_list_id uuid references cdl_test_lists (id),
32 employee_id uuid references employee (id),
33 created_by text,
34 created_at timestamp,
35 modified_by text,
36 modified_at timestamp,
37 title text,
38 work_location text,
39 cdl text,
40 state text
41);
42
43
44create table if not exists alcohol_test_results
45(
46 id uuid primary key,
47 cdl_test_result_id uuid references cdl_test_list_employees (id),
48 created_by text,
49 created_at timestamp,
50 modified_by text,
51 modified_at timestamp,
52 test_status text,
53 test_results double precision,
54 test_date timestamp,
55 confirm_status text,
56 confirm_results double precision
57);
58
59create table if not exists drug_test_results
60(
61 id uuid primary key,
62 cdl_test_result_id uuid references cdl_test_list_employees (id),
63 created_by text,
64 created_at timestamp,
65 modified_by text,
66 modified_at timestamp,
67 drug_test_status text,
68 specimen_reference text,
69 result text,
70 test_date timestamp,
71 diluted_sample boolean,
72 positive_results text[]
73);
74
75