mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-27 13:21:32 +00:00
2016afc9db
* A first pass at user / community blocking. #426 * Adding unit tests for person and community block. * Moving migration * Fixing creator_blocked for comment queries, added tests. * Don't let a person block themselves * Fix post creator_blocked * Adding creator_blocked to PersonMentionView * Moving blocked and follows to MyUserInfo * Rename to local_user_view * Add moderates to MyUserInfo * Adding BlockCommunityResponse * Fixing name, and check_person_block * Fixing tests. * Using type in Blockable trait. * Changing recipient to target, adding unfollow to block action.
15 lines
599 B
SQL
15 lines
599 B
SQL
create table person_block (
|
|
id serial primary key,
|
|
person_id int references person on update cascade on delete cascade not null,
|
|
target_id int references person on update cascade on delete cascade not null,
|
|
published timestamp not null default now(),
|
|
unique(person_id, target_id)
|
|
);
|
|
|
|
create table community_block (
|
|
id serial primary key,
|
|
person_id int references person on update cascade on delete cascade not null,
|
|
community_id int references community on update cascade on delete cascade not null,
|
|
published timestamp not null default now(),
|
|
unique(person_id, community_id)
|
|
);
|