-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
43 lines (38 loc) · 974 Bytes
/
schema.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
create table users (
id serial primary key,
name varchar(50),
username varchar(20),
pwhash varchar(100),
email varchar(50),
home varchar(50),
likes text,
dislikes text,
pal text
);
create table artists (
id serial primary key,
name text
);
create table events (
id varchar(18) primary key,
artist varchar(200),
venue text,
city text,
state text,
date DATE
);
create table user_shows (
id serial primary key,
user_id integer references users (id) ON DELETE CASCADE,
event_id varchar references events (id) ON DELETE CASCADE
);
create table user_friends (
id serial primary key,
user_id integer references users (id) ON DELETE CASCADE,
friend_id integer references users (id) ON DELETE CASCADE
);
create table user_artists (
id serial primary key,
user_id integer references users (id) ON DELETE CASCADE,
artist_id integer references artists (id) ON DELETE CASCADE
);