-
Notifications
You must be signed in to change notification settings - Fork 4
/
gymmanager.sql
225 lines (164 loc) · 9.28 KB
/
gymmanager.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
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.3
-- Dumped by pg_dump version 12.3
-- Started on 2020-07-16 22:31:34
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- TOC entry 2836 (class 1262 OID 16393)
-- Name: gymmanager; Type: DATABASE; Schema: -; Owner: postgres
--
ALTER DATABASE gymmanager OWNER TO postgres;
\connect gymmanager
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- TOC entry 203 (class 1259 OID 16396)
-- Name: instructors; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.instructors (
id integer NOT NULL,
name text,
avatar_url text,
gender text,
services text,
birth timestamp without time zone,
created_at timestamp without time zone
);
ALTER TABLE public.instructors OWNER TO postgres;
--
-- TOC entry 202 (class 1259 OID 16394)
-- Name: instructors_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.instructors_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.instructors_id_seq OWNER TO postgres;
--
-- TOC entry 2837 (class 0 OID 0)
-- Dependencies: 202
-- Name: instructors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.instructors_id_seq OWNED BY public.instructors.id;
--
-- TOC entry 205 (class 1259 OID 16470)
-- Name: members; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.members (
id integer NOT NULL,
name text,
avatar_url text,
email text,
gender text,
birth timestamp without time zone,
blood text,
weight integer,
height integer,
instructor_id integer
);
ALTER TABLE public.members OWNER TO postgres;
--
-- TOC entry 204 (class 1259 OID 16468)
-- Name: members_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.members_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.members_id_seq OWNER TO postgres;
--
-- TOC entry 2838 (class 0 OID 0)
-- Dependencies: 204
-- Name: members_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE public.members_id_seq OWNED BY public.members.id;
--
-- TOC entry 2695 (class 2604 OID 16399)
-- Name: instructors id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.instructors ALTER COLUMN id SET DEFAULT nextval('public.instructors_id_seq'::regclass);
--
-- TOC entry 2696 (class 2604 OID 16473)
-- Name: members id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.members ALTER COLUMN id SET DEFAULT nextval('public.members_id_seq'::regclass);
--
-- TOC entry 2828 (class 0 OID 16396)
-- Dependencies: 203
-- Data for Name: instructors; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public.instructors (id, name, avatar_url, gender, services, birth, created_at) VALUES (10, 'Karla Wo', 'https://images.unsplash.com/photo-1560233075-4c1e2007908e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=358&q=80', 'F', 'yoga, meditação', '1993-01-01 00:00:00', '2020-07-08 00:00:00');
INSERT INTO public.instructors (id, name, avatar_url, gender, services, birth, created_at) VALUES (1, 'Alex Ipsum', 'https://images.unsplash.com/photo-1517838277536-f5f99be501cd?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80', 'M', 'Calistenia, Musculação', '1993-01-02 00:00:00', '2020-06-02 00:00:00');
INSERT INTO public.instructors (id, name, avatar_url, gender, services, birth, created_at) VALUES (11, 'Caio Wo', 'https://images.unsplash.com/photo-1551763337-e05b91996d32?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80', 'M', 'Crossfit, musculação', '1998-02-01 00:00:00', '2020-07-09 00:00:00');
INSERT INTO public.instructors (id, name, avatar_url, gender, services, birth, created_at) VALUES (12, 'Luka Gonzales', 'https://images.unsplash.com/photo-1557408833-91ef36660bcb?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=748&q=80', 'M', 'Boxe, muay thai', '1986-02-01 00:00:00', '2020-07-09 00:00:00');
INSERT INTO public.instructors (id, name, avatar_url, gender, services, birth, created_at) VALUES (2, 'Guilherme Saraiva', 'https://images.unsplash.com/photo-1563053764-85dbf278c408?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80', 'M', 'Musculação, crossfit', '1980-02-01 00:00:00', '2020-06-03 00:00:00');
INSERT INTO public.instructors (id, name, avatar_url, gender, services, birth, created_at) VALUES (5, 'Julia Consectetur ', 'https://images.unsplash.com/photo-1548690312-e3b507d8c110?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=634&q=80', 'F', 'jiu jitsu, judo', '1992-01-01 00:00:00', '2020-07-01 00:00:00');
INSERT INTO public.instructors (id, name, avatar_url, gender, services, birth, created_at) VALUES (7, 'Estephani Null', 'https://images.unsplash.com/photo-1471277876629-37eaac632a24?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=334&q=80', 'F', 'boxe, judo', '1990-01-01 00:00:00', '2020-07-08 00:00:00');
INSERT INTO public.instructors (id, name, avatar_url, gender, services, birth, created_at) VALUES (8, 'Etan Park', 'https://images.unsplash.com/photo-1520920200465-946379ad1349?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=353&q=80', 'M', 'calistenia, parkour', '1988-01-01 00:00:00', '2020-07-08 00:00:00');
INSERT INTO public.instructors (id, name, avatar_url, gender, services, birth, created_at) VALUES (9, 'Marie Star', 'https://images.unsplash.com/photo-1550345332-d73a0111ad25?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=299&q=80', 'F', 'Ginástica Olímpica', '1995-01-01 00:00:00', '2020-07-08 00:00:00');
--
-- TOC entry 2830 (class 0 OID 16470)
-- Dependencies: 205
-- Data for Name: members; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO public.members (id, name, avatar_url, email, gender, birth, blood, weight, height, instructor_id) VALUES (3, 'Caio Amet', 'https://images.unsplash.com/photo-1583500178964-98351600826a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=634&q=80', '[email protected]', 'M', '1995-06-01 00:00:00', 'A1', 60, 160, 1);
INSERT INTO public.members (id, name, avatar_url, email, gender, birth, blood, weight, height, instructor_id) VALUES (7, 'Rubens Dolor', 'https://upl.stack.com/wp-content/uploads/2013/07/Skinny-Flex-629x408.jpg', '[email protected]', 'M', '1992-02-05 00:00:00', 'AB0', 55, 165, 2);
INSERT INTO public.members (id, name, avatar_url, email, gender, birth, blood, weight, height, instructor_id) VALUES (8, 'José Doe', 'https://images.unsplash.com/photo-1557851114-3f672a50722a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=333&q=80', '[email protected]', 'M', '1989-02-05 00:00:00', 'A1', 62, 178, 12);
INSERT INTO public.members (id, name, avatar_url, email, gender, birth, blood, weight, height, instructor_id) VALUES (9, 'Anna Ane', 'https://images.unsplash.com/photo-1542103749-8ef59b94f47e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1050&q=80', '[email protected]', 'F', '1998-02-05 00:00:00', 'O1', 50, 155, 9);
INSERT INTO public.members (id, name, avatar_url, email, gender, birth, blood, weight, height, instructor_id) VALUES (1, 'Daniel', 'https://images.unsplash.com/photo-1549361426-ee116328745c?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=925&q=80', '[email protected]', 'M', '1980-01-01 00:00:00', 'AB1', 85, 180, 5);
INSERT INTO public.members (id, name, avatar_url, email, gender, birth, blood, weight, height, instructor_id) VALUES (4, 'Leon K', 'https://images.unsplash.com/photo-1544723795-3fb6469f5b39?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=635&q=80', '[email protected]', 'M', '1988-02-05 00:00:00', 'O1', 70, 178, 1);
--
-- TOC entry 2839 (class 0 OID 0)
-- Dependencies: 202
-- Name: instructors_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.instructors_id_seq', 12, true);
--
-- TOC entry 2840 (class 0 OID 0)
-- Dependencies: 204
-- Name: members_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.members_id_seq', 9, true);
--
-- TOC entry 2698 (class 2606 OID 16401)
-- Name: instructors instructors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.instructors
ADD CONSTRAINT instructors_pkey PRIMARY KEY (id);
--
-- TOC entry 2700 (class 2606 OID 16475)
-- Name: members members_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.members
ADD CONSTRAINT members_pkey PRIMARY KEY (id);
-- Completed on 2020-07-16 22:31:34
--
-- PostgreSQL database dump complete
--