forked from CodewarsClone/Codewars
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtables.sql
More file actions
48 lines (42 loc) · 1.17 KB
/
Copy pathtables.sql
File metadata and controls
48 lines (42 loc) · 1.17 KB
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
DROP TABLE IF EXISTS kata_ratings, sol_ratings, solutions, katas, users;
CREATE TABLE users (
id serial primary key,
github_id varchar(255),
name varchar(80),
email varchar(255),
username varchar (40),
picture_url text,
points integer
);
CREATE TABLE katas (
id serial primary key,
creator varchar(80),
kyu integer not null,
test_script json not null,
description text,
starter_code text not null,
name varchar(255),
examples json,
tags json,
languages json
);
CREATE TABLE solutions (
id serial primary key,
user_id integer references users(id),
kata_id integer references katas(id),
script text not null
);
CREATE TABLE sol_ratings (
id serial primary key,
user_id integer references users(id),
solution_id integer references solutions(id),
liked boolean not null
);
CREATE TABLE kata_ratings (
id serial primary key,
user_id integer references users(id),
kata_id integer references katas(id),
liked boolean not null
);
INSERT INTO users (github_id, name, email, username, picture_url, points)
VALUES ('22752236', 'Joshua Baert', 'developer@baert.io', 'JoshuaBaert', 'https://avatars.githubusercontent.com/u/22752236?v=3', 4);