-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcopcast-db.sql
420 lines (305 loc) · 9.44 KB
/
copcast-db.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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.3.5
-- Dumped by pg_dump version 9.3.1
-- Started on 2014-10-28 16:27:45 BRST
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- TOC entry 182 (class 3079 OID 12018)
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- TOC entry 2275 (class 0 OID 0)
-- Dependencies: 182
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = public, pg_catalog;
SET default_with_oids = false;
--
-- TOC entry 170 (class 1259 OID 16386)
-- Name: SequelizeMeta; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE "SequelizeMeta" (
id integer NOT NULL,
"from" character varying(255),
"to" character varying(255)
);
--
-- TOC entry 171 (class 1259 OID 16392)
-- Name: SequelizeMeta_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE "SequelizeMeta_id_seq"
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2276 (class 0 OID 0)
-- Dependencies: 171
-- Name: SequelizeMeta_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE "SequelizeMeta_id_seq" OWNED BY "SequelizeMeta".id;
--
-- TOC entry 172 (class 1259 OID 16394)
-- Name: access_tokens; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE access_tokens (
id uuid NOT NULL,
scope character varying(255) NOT NULL,
"expirationDate" timestamp with time zone,
"createdAt" timestamp with time zone NOT NULL,
"updatedAt" timestamp with time zone NOT NULL,
"userId" bigint
);
--
-- TOC entry 173 (class 1259 OID 16397)
-- Name: groups; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE groups (
id integer NOT NULL,
name character varying(255) NOT NULL,
"createdAt" timestamp with time zone NOT NULL,
"updatedAt" timestamp with time zone NOT NULL,
"isAdmin" boolean,
lat double precision,
lng double precision
);
--
-- TOC entry 174 (class 1259 OID 16400)
-- Name: groups_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE groups_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2277 (class 0 OID 0)
-- Dependencies: 174
-- Name: groups_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE groups_id_seq OWNED BY groups.id;
--
-- TOC entry 175 (class 1259 OID 16402)
-- Name: histories; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE histories (
id integer NOT NULL,
"createdAt" timestamp with time zone,
"updatedAt" timestamp with time zone,
"previousState" character varying(255),
"nextState" character varying(255),
"userId" bigint,
date timestamp with time zone
);
--
-- TOC entry 176 (class 1259 OID 16408)
-- Name: histories_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE histories_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2278 (class 0 OID 0)
-- Dependencies: 176
-- Name: histories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE histories_id_seq OWNED BY histories.id;
--
-- TOC entry 177 (class 1259 OID 16410)
-- Name: locations; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE locations (
id integer NOT NULL,
date timestamp with time zone NOT NULL,
lat double precision NOT NULL,
lng double precision NOT NULL,
"userId" bigint,
accuracy double precision,
satellites integer,
provider character varying(255),
bearing double precision,
speed double precision
);
--
-- TOC entry 178 (class 1259 OID 16413)
-- Name: locations_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE locations_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2279 (class 0 OID 0)
-- Dependencies: 178
-- Name: locations_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE locations_id_seq OWNED BY locations.id;
--
-- TOC entry 179 (class 1259 OID 16415)
-- Name: users; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE users (
id bigint NOT NULL,
username character varying(255) NOT NULL,
"passwordHash" character varying(1024) NOT NULL,
"passwordSalt" character varying(1024) NOT NULL,
name character varying(255) NOT NULL,
email character varying(255) NOT NULL,
"gcmRegistration" character varying(1024),
"isAdmin" boolean DEFAULT false NOT NULL,
"lastLat" double precision,
"lastLng" double precision,
"lastLocationUpdateDate" timestamp with time zone,
"createdAt" timestamp with time zone NOT NULL,
"updatedAt" timestamp with time zone NOT NULL,
"groupId" integer,
"profilePicture" character varying(255)
);
--
-- TOC entry 180 (class 1259 OID 16422)
-- Name: users_id_seq; Type: SEQUENCE; Schema: public; Owner: -
--
CREATE SEQUENCE users_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2280 (class 0 OID 0)
-- Dependencies: 180
-- Name: users_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--
ALTER SEQUENCE users_id_seq OWNED BY users.id;
--
-- TOC entry 181 (class 1259 OID 16424)
-- Name: videos; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE videos (
id uuid NOT NULL,
date timestamp with time zone NOT NULL,
duration integer NOT NULL,
"userId" integer
);
--
-- TOC entry 2124 (class 2604 OID 16455)
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY "SequelizeMeta" ALTER COLUMN id SET DEFAULT nextval('"SequelizeMeta_id_seq"'::regclass);
--
-- TOC entry 2125 (class 2604 OID 16456)
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY groups ALTER COLUMN id SET DEFAULT nextval('groups_id_seq'::regclass);
--
-- TOC entry 2126 (class 2604 OID 16457)
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY histories ALTER COLUMN id SET DEFAULT nextval('histories_id_seq'::regclass);
--
-- TOC entry 2127 (class 2604 OID 16458)
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY locations ALTER COLUMN id SET DEFAULT nextval('locations_id_seq'::regclass);
--
-- TOC entry 2129 (class 2604 OID 16459)
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
--
ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass);
--
-- TOC entry 2257 (class 0 OID 16386)
-- Dependencies: 170
-- Data for Name: SequelizeMeta; Type: TABLE DATA; Schema: public; Owner: -
--
INSERT INTO "SequelizeMeta" (id, "from", "to") VALUES (1, '20140318105826', '20140318105826');
INSERT INTO "SequelizeMeta" (id, "from", "to") VALUES (2, '20140506171156', '20140506171156');
INSERT INTO "SequelizeMeta" (id, "from", "to") VALUES (3, '20140530151659', '20140530151659');
INSERT INTO "SequelizeMeta" (id, "from", "to") VALUES (4, '20140530151659', '20140609152651');
INSERT INTO "SequelizeMeta" (id, "from", "to") VALUES (5, '20140714143603', '20140714143603');
INSERT INTO "SequelizeMeta" (id, "from", "to") VALUES (6, '20140923143304', '20140923143304');
--
-- TOC entry 2281 (class 0 OID 0)
-- Dependencies: 171
-- Name: SequelizeMeta_id_seq; Type: SEQUENCE SET; Schema: public; Owner: -
--
SELECT pg_catalog.setval('"SequelizeMeta_id_seq"', 6, true);
--
-- TOC entry 2131 (class 2606 OID 16433)
-- Name: SequelizeMeta_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY "SequelizeMeta"
ADD CONSTRAINT "SequelizeMeta_pkey" PRIMARY KEY (id);
--
-- TOC entry 2133 (class 2606 OID 16435)
-- Name: access_tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY access_tokens
ADD CONSTRAINT access_tokens_pkey PRIMARY KEY (id);
--
-- TOC entry 2135 (class 2606 OID 16437)
-- Name: groups_name_key; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY groups
ADD CONSTRAINT groups_name_key UNIQUE (name);
--
-- TOC entry 2137 (class 2606 OID 16439)
-- Name: groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY groups
ADD CONSTRAINT groups_pkey PRIMARY KEY (id);
--
-- TOC entry 2139 (class 2606 OID 16441)
-- Name: histories_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY histories
ADD CONSTRAINT histories_pkey PRIMARY KEY (id);
--
-- TOC entry 2141 (class 2606 OID 16443)
-- Name: locations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY locations
ADD CONSTRAINT locations_pkey PRIMARY KEY (id);
--
-- TOC entry 2143 (class 2606 OID 16445)
-- Name: users_email_key; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY users
ADD CONSTRAINT users_email_key UNIQUE (email);
--
-- TOC entry 2145 (class 2606 OID 16447)
-- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY users
ADD CONSTRAINT users_pkey PRIMARY KEY (id);
--
-- TOC entry 2147 (class 2606 OID 16449)
-- Name: users_username_key; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY users
ADD CONSTRAINT users_username_key UNIQUE (username);
--
-- TOC entry 2149 (class 2606 OID 16451)
-- Name: videos_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY videos
ADD CONSTRAINT videos_pkey PRIMARY KEY (id);
-- Completed on 2014-10-28 16:27:48 BRST
--
-- PostgreSQL database dump complete
--