From 1b4dbc8566df643d3e1ef148e9e7abccb4f8526c Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Sun, 8 Sep 2024 01:17:58 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20reaction=E3=81=AE=E3=83=86=E3=83=BC?= =?UTF-8?q?=E3=83=96=E3=83=AB=E5=AE=9A=E7=BE=A9=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exposedrepository/ExposedReactionRepository.kt | 2 +- .../main/resources/db/migration/V1__Init_DB.sql | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedReactionRepository.kt b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedReactionRepository.kt index 1d1d7564..92c8ebd9 100644 --- a/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedReactionRepository.kt +++ b/hideout-core/src/main/kotlin/dev/usbharu/hideout/core/infrastructure/exposedrepository/ExposedReactionRepository.kt @@ -76,7 +76,7 @@ fun ResultRow.toReaction(): Reaction { } -object Reactions : Table("Reactions") { +object Reactions : Table("reactions") { val id = long("id") val postId = long("post_id").references(Posts.id) val actorId = long("actor_id").references(Actors.id) diff --git a/hideout-core/src/main/resources/db/migration/V1__Init_DB.sql b/hideout-core/src/main/resources/db/migration/V1__Init_DB.sql index 6ce43568..44bfbcf5 100644 --- a/hideout-core/src/main/resources/db/migration/V1__Init_DB.sql +++ b/hideout-core/src/main/resources/db/migration/V1__Init_DB.sql @@ -318,4 +318,16 @@ create table if not exists filter_keywords keyword varchar(1000) not null, mode varchar(100) not null, constraint fk_filter_keywords_filter_id__id foreign key (filter_id) references filters (id) on delete cascade on update cascade -) \ No newline at end of file +); + +create table if not exists reactions +( + id bigint primary key, + post_id bigint not null, + actor_id bigint not null, + custom_emoji_id bigint null, + unicode_emoji varchar(100) not null, + created_at timestamp not null, + constraint fk_reactions_post_id__id foreign key (post_id) references posts (id) on delete cascade on update cascade, + constraint fk_reactions_actor_id__id foreign key (actor_id) references actors (id) on delete cascade on update cascade +); \ No newline at end of file