-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdatabase.sql
42 lines (36 loc) · 1.05 KB
/
database.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
CREATE DATABASE pov;
CREATE TABLE authors(
id SERIAL PRIMARY KEY,
"name" VARCHAR(255),
imageUrl VARCHAR(255)
);
CREATE TABLE categories(
id SERIAL PRIMARY KEY,
"name" VARCHAR(255)
);
CREATE TABLE articles(
id SERIAL PRIMARY KEY,
title VARCHAR(255),
markdownUrl VARCHAR(255),
categories VARCHAR(255),
authorId INTEGER,
timePublished VARCHAR(255),
imageUrl VARCHAR(255)
);
CREATE TABLE comments(
id SERIAL PRIMARY KEY,
content VARCHAR(255),
title VARCHAR(255),
timeSent VARCHAR(255),
sentBy VARCHAR(255),
articleId INTEGER
);
INSERT INTO categories (name) VALUES ('Israel');
INSERT INTO categories (name) VALUES ('World');
INSERT INTO categories (name) VALUES ('COVID-19');
INSERT INTO categories (name) VALUES ('Middle East');
INSERT INTO categories (name) VALUES ('Tech');
INSERT INTO categories (name) VALUES ('Economy');
INSERT INTO categories (name) VALUES ('Enviroment');
INSERT INTO categories (name) VALUES ('Travel');
INSERT INTO authors (name, imageUrl) VALUES ('Itay Schechner', '/itay.png');