summaryrefslogtreecommitdiffstats
path: root/server/migrations
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-03-28 12:32:08 -0700
committerDessalines <tyhou13@gmx.com>2019-03-28 12:32:08 -0700
commit49c61fc31818e92fea00f8cd9d1c048104d8ecbf (patch)
tree3d23898c675722809f585ee81ae53ed9763fe87b /server/migrations
parent05f0aee3ea88d3982e2efe6230f8c591540e4c92 (diff)
Adding comment voting
- Extracting out some components. - Fixing an issue with window refreshing websockets.
Diffstat (limited to 'server/migrations')
-rw-r--r--server/migrations/2019-02-27-170003_create_community/up.sql2
-rw-r--r--server/migrations/2019-03-03-163336_create_post/up.sql1
-rw-r--r--server/migrations/2019-03-05-233828_create_comment/up.sql4
3 files changed, 5 insertions, 2 deletions
diff --git a/server/migrations/2019-02-27-170003_create_community/up.sql b/server/migrations/2019-02-27-170003_create_community/up.sql
index 1ee2e51d..651a9432 100644
--- a/server/migrations/2019-02-27-170003_create_community/up.sql
+++ b/server/migrations/2019-02-27-170003_create_community/up.sql
@@ -18,3 +18,5 @@ create table community_follower (
fedi_user_id text not null,
published timestamp not null default now()
);
+
+insert into community (name) values ('main');
diff --git a/server/migrations/2019-03-03-163336_create_post/up.sql b/server/migrations/2019-03-03-163336_create_post/up.sql
index f22192f3..14294c8f 100644
--- a/server/migrations/2019-03-03-163336_create_post/up.sql
+++ b/server/migrations/2019-03-03-163336_create_post/up.sql
@@ -16,4 +16,3 @@ create table post_like (
score smallint not null, -- -1, or 1 for dislike, like, no row for no opinion
published timestamp not null default now()
);
-
diff --git a/server/migrations/2019-03-05-233828_create_comment/up.sql b/server/migrations/2019-03-05-233828_create_comment/up.sql
index 63fc758d..c80f8d18 100644
--- a/server/migrations/2019-03-05-233828_create_comment/up.sql
+++ b/server/migrations/2019-03-05-233828_create_comment/up.sql
@@ -11,7 +11,9 @@ create table comment (
create table comment_like (
id serial primary key,
comment_id int references comment on update cascade on delete cascade not null,
+ post_id int references post on update cascade on delete cascade not null,
fedi_user_id text not null,
score smallint not null, -- -1, or 1 for dislike, like, no row for no opinion
- published timestamp not null default now()
+ published timestamp not null default now(),
+ unique(comment_id, fedi_user_id)
);