forked from dermatologist/pyomop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebapi_source.sql
More file actions
54 lines (45 loc) · 2.35 KB
/
webapi_source.sql
File metadata and controls
54 lines (45 loc) · 2.35 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
54
INSERT INTO webapi.source (source_id, source_name, source_key, source_connection, source_dialect)
SELECT nextval('webapi.source_sequence'), 'Demo CDM', 'DEMO_CDM', 'jdbc:postgresql://localhost:5432/postgres?user=postgres&password=mypass', 'postgresql';
INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority)
SELECT nextval('webapi.source_daimon_sequence'), source_id, 0, 'demo_cdm', 0
FROM webapi.source
WHERE source_key = 'DEMO_CDM'
;
INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority)
SELECT nextval('webapi.source_daimon_sequence'), source_id, 1, 'demo_cdm', 1
FROM webapi.source
WHERE source_key = 'DEMO_CDM'
;
INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority)
SELECT nextval('webapi.source_daimon_sequence'), source_id, 2, 'demo_cdm_results', 1
FROM webapi.source
WHERE source_key = 'DEMO_CDM'
;
INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority)
SELECT nextval('webapi.source_daimon_sequence'), source_id, 5, 'demo_temp', 0
FROM webapi.source
WHERE source_key = 'DEMO_CDM'
;
INSERT INTO webapi.source (source_id, source_name, source_key, source_connection, source_dialect)
SELECT nextval('webapi.source_sequence'), 'My CDM', 'MY_CDM', 'jdbc:postgresql://localhost:5432/postgres?user=postgres&password=mypass', 'postgresql';
INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority)
SELECT nextval('webapi.source_daimon_sequence'), source_id, 0, 'my_cdm', 0
FROM webapi.source
WHERE source_key = 'MY_CDM'
;
INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority)
-- This vocabulary has higher priority --
SELECT nextval('webapi.source_daimon_sequence'), source_id, 1, 'my_cdm', 2
FROM webapi.source
WHERE source_key = 'MY_CDM'
;
INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority)
SELECT nextval('webapi.source_daimon_sequence'), source_id, 2, 'demo_cdm_results', 1
FROM webapi.source
WHERE source_key = 'MY_CDM'
;
INSERT INTO webapi.source_daimon (source_daimon_id, source_id, daimon_type, table_qualifier, priority)
SELECT nextval('webapi.source_daimon_sequence'), source_id, 5, 'demo_temp', 0
FROM webapi.source
WHERE source_key = 'MY_CDM'
;