-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema
90 lines (81 loc) · 2 KB
/
schema
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
create table comments (
id bigint not null primary key,
created_at timestamp default now(),
"user" uuid,
comment text not null,
song_id bigint,
commentPosition double not null,
avatarURl text
);
create table role_permissions (
id bigint not null primary key,
role public.app_role not null,
permission public.app_permission not null
);
create table profiles (
id uuid default uuid_generate_v4() primary key,
updated_at timestamp default now(),
username text,
avatar_url text,
website text,
instagram_url text,
twitter_url text,
spotify_url text,
soundcloud_url text,
absolute_avatar_url text,
bio text,
status public.user_status
);
create table users (
id uuid default uuid_generate_v4() primary key,
username text,
status public.user_status
);
create table channels (
id bigint not null primary key,
inserted_at timestamp default now() not null,
slug text references profiles (username),
created_by uuid references profiles (id),
message_to uuid references profiles (id),
created_by_username text
);
create table messages (
id bigint not null primary key,
inserted_at timestamp default now() not null,
message text,
user_id uuid,
channel_id bigint references channels (id),
username text,
absolute_avatar_url text
);
create table user_roles (
id bigint not null primary key,
user_id uuid references profiles (id),
role public.app_role not null
);
create table potentialCollaborators (
id bigint not null primary key,
added_at timestamp default now(),
song_id bigint,
"user" uuid references profiles (id),
username text,
absolute_avatar_url text
);
create table songs (
id bigint not null primary key,
created_at timestamp default now(),
genre text not null,
description text,
needs text not null,
open boolean not null,
finished_song text,
artist text,
artist_id uuid,
song_url text,
instagram_url text,
twitter_url text,
spotify_url text,
soundcloud_url text,
absolute_song_url text,
absolute_avatar_url text
);