sojorn/_legacy/supabase/migrations/20260114_zero_tolerance_moderation.sql
2026-02-15 00:33:24 -06:00

19 lines
497 B
SQL

alter table profiles
add column if not exists strikes integer not null default 0;
alter table posts
add column if not exists moderation_status text not null default 'approved';
do $$
begin
if not exists (
select 1
from pg_constraint
where conname = 'posts_moderation_status_check'
) then
alter table posts
add constraint posts_moderation_status_check
check (moderation_status in ('approved', 'flagged_bigotry', 'flagged_nsfw', 'rejected'));
end if;
end $$;