Files
gongxue-base/supabase/migrations/202607120001_destructive_test_environment_safety.sql
2026-07-12 19:26:57 +08:00

16 lines
748 B
SQL

create table if not exists app_private.environment_safety (
id boolean primary key default true check (id),
environment text not null check (environment in ('local', 'test', 'ci', 'staging', 'production')),
allow_destructive_tests boolean not null default false,
created_at timestamptz not null default now(),
updated_at timestamptz not null default now()
);
comment on table app_private.environment_safety is
'Fail-closed database marker for destructive integration fixtures. Production and staging must never set allow_destructive_tests=true.';
revoke all on app_private.environment_safety from public, anon, authenticated;
-- Runtime access is granted centrally by
-- 202607120013_backend_runtime_roles.sql after the roles exist.