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