-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.sql
executable file
·285 lines (193 loc) · 6.53 KB
/
demo.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
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.3
-- Dumped by pg_dump version 9.6.3
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: SequelizeMeta; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE "SequelizeMeta" (
name character varying(255) NOT NULL
);
ALTER TABLE "SequelizeMeta" OWNER TO postgres;
--
-- Name: articles; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE articles (
id integer NOT NULL,
title character varying(255),
body text,
id_author integer,
id_tag integer,
"createdAt" timestamp with time zone NOT NULL,
"updatedAt" timestamp with time zone NOT NULL
);
ALTER TABLE articles OWNER TO postgres;
--
-- Name: articles_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE articles_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE articles_id_seq OWNER TO postgres;
--
-- Name: articles_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE articles_id_seq OWNED BY articles.id;
--
-- Name: authors; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE authors (
id integer NOT NULL,
first_name character varying(255),
last_name character varying(255),
religion character varying(255),
gender character varying(255),
age integer,
"createdAt" timestamp with time zone NOT NULL,
"updatedAt" timestamp with time zone NOT NULL
);
ALTER TABLE authors OWNER TO postgres;
--
-- Name: authors_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE authors_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE authors_id_seq OWNER TO postgres;
--
-- Name: authors_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE authors_id_seq OWNED BY authors.id;
--
-- Name: tags; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tags (
id integer NOT NULL,
name character varying(255),
"createdAt" timestamp with time zone NOT NULL,
"updatedAt" timestamp with time zone NOT NULL
);
ALTER TABLE tags OWNER TO postgres;
--
-- Name: tags_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE tags_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE tags_id_seq OWNER TO postgres;
--
-- Name: tags_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE tags_id_seq OWNED BY tags.id;
--
-- Name: articles id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY articles ALTER COLUMN id SET DEFAULT nextval('articles_id_seq'::regclass);
--
-- Name: authors id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY authors ALTER COLUMN id SET DEFAULT nextval('authors_id_seq'::regclass);
--
-- Name: tags id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tags ALTER COLUMN id SET DEFAULT nextval('tags_id_seq'::regclass);
--
-- Data for Name: SequelizeMeta; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY "SequelizeMeta" (name) FROM stdin;
20180219191205-create-article.js
20180219191404-create-tag.js
20180219191545-create-author.js
\.
--
-- Data for Name: articles; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY articles (id, title, body, id_author, id_tag, "createdAt", "updatedAt") FROM stdin;
1 Using Middleware On Express JS This is How to Use Middleware, you need to .... ya that`s it 1 2 2018-02-20 20:32:21.008+07 2018-02-20 20:32:21.009+07
2 Using Session On Express JS Before we use Session the one thing that you should know is about session it self, you need to .... ya that`s it 2 3 2018-02-20 20:32:21.009+07 2018-02-20 20:32:21.009+07
\.
--
-- Name: articles_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('articles_id_seq', 2, true);
--
-- Data for Name: authors; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY authors (id, first_name, last_name, religion, gender, age, "createdAt", "updatedAt") FROM stdin;
1 erwin ramadhan islam male 20 2018-02-20 02:29:09.724+07 2018-02-20 02:29:09.729+07
2 cu chu lain islam male 22 2018-02-20 02:31:32.337+07 2018-02-20 02:31:32.34+07
3 ryougi shiki budha female 19 2018-02-20 02:32:30.686+07 2018-02-20 02:32:30.69+07
4 nara sikamaru islam male 17 2018-02-20 02:47:51.893+07 2018-02-20 03:37:48.486+07
\.
--
-- Name: authors_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('authors_id_seq', 4, true);
--
-- Data for Name: tags; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY tags (id, name, "createdAt", "updatedAt") FROM stdin;
1 Javascript 2018-02-20 20:32:01.138+07 2018-02-20 20:32:01.138+07
2 Middleware 2018-02-20 20:32:01.138+07 2018-02-20 20:32:01.138+07
3 Session 2018-02-20 20:32:01.138+07 2018-02-20 20:32:01.138+07
4 Multer 2018-02-20 20:32:01.138+07 2018-02-20 20:32:01.138+07
5 Functional Programming 2018-02-20 20:32:01.138+07 2018-02-20 20:32:01.138+07
6 Asynchronous 2018-02-20 20:32:01.138+07 2018-02-20 20:32:01.138+07
7 Synchronous 2018-02-20 20:32:01.138+07 2018-02-20 20:32:01.138+07
\.
--
-- Name: tags_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('tags_id_seq', 7, true);
--
-- Name: SequelizeMeta SequelizeMeta_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY "SequelizeMeta"
ADD CONSTRAINT "SequelizeMeta_pkey" PRIMARY KEY (name);
--
-- Name: articles articles_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY articles
ADD CONSTRAINT articles_pkey PRIMARY KEY (id);
--
-- Name: authors authors_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY authors
ADD CONSTRAINT authors_pkey PRIMARY KEY (id);
--
-- Name: tags tags_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tags
ADD CONSTRAINT tags_pkey PRIMARY KEY (id);
--
-- PostgreSQL database dump complete
--