-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathinitial.sql
144 lines (101 loc) · 2.65 KB
/
initial.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
CREATE SCHEMA vp;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: calls; Type: TABLE; Schema: vp; Owner: -
--
CREATE TABLE vp.calls (
call_uuid uuid NOT NULL,
call_start_ts timestamp with time zone,
call_end_ts timestamp with time zone,
caller character varying,
calle character varying,
duration integer,
direction character varying
);
--
-- Name: calls_meta; Type: TABLE; Schema: vp; Owner: -
--
CREATE TABLE vp.calls_meta (
call_uuid uuid NOT NULL,
meta jsonb
);
--
-- Name: calls_transcription; Type: TABLE; Schema: vp; Owner: -
--
CREATE TABLE vp.calls_transcription (
call_uuid uuid NOT NULL,
transcription jsonb
);
--
-- Name: files; Type: TABLE; Schema: vp; Owner: -
--
CREATE TABLE vp.files (
call_uuid uuid NOT NULL,
file_server character varying,
file_path text,
num_channels smallint
);
--
-- Name: tasks; Type: TABLE; Schema: vp; Owner: -
--
CREATE TABLE vp.tasks (
call_uuid uuid NOT NULL,
task jsonb
);
--
-- Name: transcript_queue; Type: TABLE; Schema: vp; Owner: -
--
CREATE TABLE vp.transcript_queue (
file_server character varying,
file_path text,
status character varying,
call_uuid uuid NOT NULL
);
CREATE TABLE IF NOT EXISTS vp.calls_tags
(
call_uuid uuid NOT NULL,
tags_json jsonb,
CONSTRAINT calls_tags_pkey PRIMARY KEY (call_uuid)
);
CREATE TABLE IF NOT EXISTS vp.tags_core
(
tag_id serial,
tag_name character varying NOT NULL,
tag_spk integer NOT NULL,
tag_texts jsonb,
CONSTRAINT tags_core_pkey PRIMARY KEY (tag_id)
);
--
-- Name: calls_meta calls_meta_pkey; Type: CONSTRAINT; Schema: vp; Owner: -
--
ALTER TABLE ONLY vp.calls_meta
ADD CONSTRAINT calls_meta_pkey PRIMARY KEY (call_uuid);
--
-- Name: calls calls_pkey; Type: CONSTRAINT; Schema: vp; Owner: -
--
ALTER TABLE ONLY vp.calls
ADD CONSTRAINT calls_pkey PRIMARY KEY (call_uuid);
--
-- Name: calls_transcription calls_transcription_pkey; Type: CONSTRAINT; Schema: vp; Owner: -
--
ALTER TABLE ONLY vp.calls_transcription
ADD CONSTRAINT calls_transcription_pkey PRIMARY KEY (call_uuid);
--
-- Name: files files_pkey; Type: CONSTRAINT; Schema: vp; Owner: -
--
ALTER TABLE ONLY vp.files
ADD CONSTRAINT files_pkey PRIMARY KEY (call_uuid);
--
-- Name: tasks tasks_pkey; Type: CONSTRAINT; Schema: vp; Owner: -
--
ALTER TABLE ONLY vp.tasks
ADD CONSTRAINT tasks_pkey PRIMARY KEY (call_uuid);
--
-- Name: transcript_queue transcript_queue_pkey; Type: CONSTRAINT; Schema: vp; Owner: -
--
ALTER TABLE ONLY vp.transcript_queue
ADD CONSTRAINT transcript_queue_pkey PRIMARY KEY (call_uuid);
--
-- PostgreSQL database dump complete
--