12 lines
486 B
MySQL
12 lines
486 B
MySQL
|
create table if not exists follows (
|
||
|
follower blob not null,
|
||
|
followee blob not null,
|
||
|
created_at int not null default (unixepoch()),
|
||
|
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);
|
||
|
|