]> Untitled Git - lemmy.git/blob - migrations/2022-11-21-204256_user-following/up.sql
Split activity table into sent and received parts (fixes #3103) (#3583)
[lemmy.git] / migrations / 2022-11-21-204256_user-following / up.sql
1 -- create user follower table with two references to persons
2 create table person_follower (
3     id serial primary key,
4     person_id int references person on update cascade on delete cascade not null,
5     follower_id int references person on update cascade on delete cascade not null,
6     published timestamp not null default now(),
7     pending boolean not null,
8     unique (follower_id, person_id)
9 );
10
11 update community_follower set pending = false where pending is null;
12 alter table community_follower alter column pending set not null;