what2watch/migrations/20240116054301_follows.up.sql

12 lines
491 B
MySQL
Raw Permalink Normal View History

2024-01-17 04:21:38 +00:00
create table if not exists follows (
follower blob not null,
followee blob not null,
2024-04-10 00:44:37 +00:00
created_at text not null default CURRENT_TIMESTAMP,
2024-01-17 04:21:38 +00:00
foreign key (follower) references users (id) on delete cascade on update no action,
foreign key (followee) references users (id) on delete cascade on update no action,
unique (follower, followee)
);
create index if not exists follows_follower_dex on follows (follower);
create index if not exists follows_followee_dex on follows (followee);