This repository has been archived on 2020-04-21. You can view files and clone it, but cannot push or open issues or pull requests.
lemmy/server/migrations/2019-12-11-181820_add_site_fields/down.sql
Dessalines aee6ee5a7c Adding some site oriented settings.
- Adding option to close registration. Fixes #350
- Adding option to disable showing NSFW buttons. Fixes #364
- Adding option to disable downvotes. Fixes #239
2019-12-11 12:21:47 -08:00

16 lines
529 B
SQL
Vendored

-- Drop the columns
drop view site_view;
alter table site drop column enable_downvotes;
alter table site drop column open_registration;
alter table site drop column enable_nsfw;
-- Rebuild the views
create view site_view as
select *,
(select name from user_ u where s.creator_id = u.id) as creator_name,
(select count(*) from user_) as number_of_users,
(select count(*) from post) as number_of_posts,
(select count(*) from comment) as number_of_comments,
(select count(*) from community) as number_of_communities
from site s;