mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 05:41:18 +00:00
21 lines
407 B
MySQL
21 lines
407 B
MySQL
|
-- if site has enable_nsfw, set a default content warning
|
||
|
UPDATE
|
||
|
site
|
||
|
SET
|
||
|
content_warning = CASE WHEN local_site.enable_nsfw THEN
|
||
|
'NSFW'
|
||
|
ELSE
|
||
|
NULL
|
||
|
END
|
||
|
FROM
|
||
|
local_site
|
||
|
-- only local site has private key
|
||
|
WHERE
|
||
|
private_key IS NOT NULL
|
||
|
-- dont overwrite existing content warning
|
||
|
AND content_warning IS NOT NULL;
|
||
|
|
||
|
ALTER TABLE local_site
|
||
|
DROP enable_nsfw;
|
||
|
|