-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdump.sql
147 lines (104 loc) · 4.52 KB
/
dump.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
145
146
--
-- PostgreSQL database dump (Remedy)
--
DROP SCHEMA IF EXISTS remedy CASCADE;
CREATE SCHEMA remedy;
DROP TABLE IF EXISTS gc_user;
DROP TABLE IF EXISTS gc_linked;
DROP TABLE IF EXISTS gc_medreminder;
DROP TABLE IF EXISTS gc_appreminder;
--
-- Name: gc_appreminder; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE remedy.gc_appreminder (
id SERIAL NOT NULL,
start timestamp without time zone NOT NULL,
stop timestamp without time zone,
timeout integer NOT NULL,
purpose character varying(50),
cancelled bit(1),
reminderMsg character varying(50),
patientId integer,
createdAt timestamp without time zone NOT NULL,
updatedAt timestamp without time zone NOT NULL
);
--
-- Name: gc_linked; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE remedy.gc_linked (
uidLinked integer NOT NULL,
uidLinker integer NOT NULL,
verified boolean NOT NULL ,
createdAt timestamp without time zone NOT NULL,
updatedAt timestamp without time zone NOT NULL
);
--
-- Name: gc_medreminder; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE remedy.gc_medreminder (
id SERIAL NOT NULL,
"time" timestamp without time zone NOT NULL,
timeout integer NOT NULL,
brandName character varying(50) NOT NULL,
genericName character varying(50) NOT NULL,
verified bit(1),
reminderMsg character varying(50),
patientId integer,
createdAt timestamp without time zone NOT NULL,
updatedAt timestamp without time zone NOT NULL
);
--
-- Name: gc_user; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE remedy.gc_user (
uid SERIAL NOT NULL,
email character varying(50) NOT NULL,
hashedpass character varying(50) NOT NULL,
salt character varying(50) NOT NULL,
role character varying(50) NOT NULL,
createdAt timestamp without time zone NOT NULL,
updatedAt timestamp without time zone NOT NULL
);
--
-- Name: gc_appreminder gc_appreminder_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY remedy.gc_appreminder
ADD CONSTRAINT gc_appreminder_pkey PRIMARY KEY (id);
--
-- Name: gc_linked gc_linked_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY remedy.gc_linked
ADD CONSTRAINT gc_linked_pkey PRIMARY KEY (uidLinked, uidLinker);
--
-- Name: gc_medreminder gc_medreminder_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY remedy.gc_medreminder
ADD CONSTRAINT gc_medreminder_pkey PRIMARY KEY (id);
--
-- Name: gc_user gc_user_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY remedy.gc_user
ADD CONSTRAINT gc_user_pkey PRIMARY KEY (uid);
--
-- Name: gc_linked fk_linked; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY remedy.gc_linked
ADD CONSTRAINT fk_linked FOREIGN KEY (uidLinked) REFERENCES remedy.gc_user(uid);
--
-- Name: gc_linked fk_linker; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY remedy.gc_linked
ADD CONSTRAINT fk_linker FOREIGN KEY (uidLinker) REFERENCES remedy.gc_user(uid);
--
-- Name: gc_medreminder fk_patient; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY remedy.gc_medreminder
ADD CONSTRAINT fk_patient FOREIGN KEY (patientId) REFERENCES remedy.gc_user(uid) ON DELETE SET NULL;
--
-- Name: gc_appreminder fk_patient; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY remedy.gc_appreminder
ADD CONSTRAINT fk_patient FOREIGN KEY (patientId) REFERENCES remedy.gc_user(uid) ON DELETE SET NULL;
--
-- PostgreSQL database dump complete
--