Files
Jyotisha/frontend/supabase/migrations/20260826030000_rectification_migration_ledger_health.sql
T
Jesse_ChenandCursor 60cbe8a75e
Independent Staging Quality Gate / validate (push) Successful in 19m18s
Independent Staging Quality Gate / publish (push) Successful in 33m22s
fix(web): read migration filenames through a definer instead of app_runtime
Staging web never became healthy because /api/health selected migration.schema_migrations as app_runtime, which is forbidden, so Docker rolled the image back.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-26 20:21:49 +08:00

26 lines
756 B
PL/PgSQL

-- app_runtime must not SELECT migration.schema_migrations (foundation privilege
-- contract). Health still needs the applied filenames, so expose a definer that
-- returns only those names. Business schema only; do not copy into
-- frontend/db/migrations (BUG-127 / BUG-144).
begin;
create or replace function public.rectification_schema_migration_filenames()
returns table(filename text)
language sql
stable
security definer
set search_path = ''
as $$
select m.filename
from migration.schema_migrations as m
order by m.filename;
$$;
revoke all on function public.rectification_schema_migration_filenames()
from public, anon, authenticated;
grant execute on function public.rectification_schema_migration_filenames()
to app_runtime;
commit;