feat: reactionのテーブル定義を追加

This commit is contained in:
usbharu 2024-09-08 01:17:58 +09:00
parent daf676503d
commit 1b4dbc8566
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
2 changed files with 14 additions and 2 deletions

View File

@ -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)

View File

@ -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
)
);
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
);