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>
26 lines
756 B
PL/PgSQL
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;
|