You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nothing in CI applies apps/stacker/supabase/migrations/*.sql to the hosted Supabase project. .github/workflows/deploy.yml runs gated Alembic migrations for retriever (RETRIEVER_DATABASE_URL) and petdata (PETDATA_DATABASE_URL), but deploy-stacker only builds and deploys to Cloudflare Pages. There is no supabase db push step anywhere in .github/workflows/ (grep returns zero supabase matches).
A stacker Supabase migration therefore merges to main and is silently not deployed. The schema change exists in the repo and in local dev (where supabase start applies it), but never reaches the hosted database.
How this surfaced
#288 added apps/stacker/supabase/migrations/20260713000000_custom_access_token_hook.sql, creating public.custom_access_token_hook. PR #289 merged. Enabling the hook in the hosted dashboard (Auth -> Hooks -> Custom Access Token) then failed: the function picker was empty for every schema, because the function had never been created in the hosted database. It only worked after a manual supabase db push from a workstation.
Every future stacker Supabase migration hits this same "merged but not deployed" gap until CI closes it.
Proposed fix
Add a gated supabase db push to the stacker deploy path, following the same ordering contract the backend migrations already use: the migration must succeed before the deploy takes traffic, and a migration failure fails the job.
Trigger: merge to main when apps/stacker/supabase/migrations/** changes (the changes job already path-filters apps/stacker/**).
Auth: SUPABASE_ACCESS_TOKEN + project ref as repo secrets; supabase link then supabase db push.
Ordering: run before the Cloudflare Pages cutover in deploy-stacker, so a failed migration blocks the frontend deploy.
Production only, never on PR previews (mirrors the existing deploy-retriever migration gating).
Alternative worth weighing: fold this into the broader hosted-Supabase config-as-code mechanism rather than a standalone step.
Notes
apps/stacker/supabase/config.toml sets signing_keys_path = "./signing_keys.json", which makes the CLI abort on any command (including db push) when that file is absent. CI needs the file present (or the setting handled) or the push fails before it starts. The file is gitignored (**/supabase/signing_keys.json) and is local-dev only.
Problem
Nothing in CI applies
apps/stacker/supabase/migrations/*.sqlto the hosted Supabase project..github/workflows/deploy.ymlruns gated Alembic migrations for retriever (RETRIEVER_DATABASE_URL) and petdata (PETDATA_DATABASE_URL), butdeploy-stackeronly builds and deploys to Cloudflare Pages. There is nosupabase db pushstep anywhere in.github/workflows/(grep returns zerosupabasematches).A stacker Supabase migration therefore merges to
mainand is silently not deployed. The schema change exists in the repo and in local dev (wheresupabase startapplies it), but never reaches the hosted database.How this surfaced
#288 added
apps/stacker/supabase/migrations/20260713000000_custom_access_token_hook.sql, creatingpublic.custom_access_token_hook. PR #289 merged. Enabling the hook in the hosted dashboard (Auth -> Hooks -> Custom Access Token) then failed: the function picker was empty for every schema, because the function had never been created in the hosted database. It only worked after a manualsupabase db pushfrom a workstation.Every future stacker Supabase migration hits this same "merged but not deployed" gap until CI closes it.
Proposed fix
Add a gated
supabase db pushto the stacker deploy path, following the same ordering contract the backend migrations already use: the migration must succeed before the deploy takes traffic, and a migration failure fails the job.mainwhenapps/stacker/supabase/migrations/**changes (thechangesjob already path-filtersapps/stacker/**).SUPABASE_ACCESS_TOKEN+ project ref as repo secrets;supabase linkthensupabase db push.deploy-stacker, so a failed migration blocks the frontend deploy.deploy-retrievermigration gating).Alternative worth weighing: fold this into the broader hosted-Supabase config-as-code mechanism rather than a standalone step.
Notes
apps/stacker/supabase/config.tomlsetssigning_keys_path = "./signing_keys.json", which makes the CLI abort on any command (includingdb push) when that file is absent. CI needs the file present (or the setting handled) or the push fails before it starts. The file is gitignored (**/supabase/signing_keys.json) and is local-dev only.Acceptance Criteria
apps/stacker/supabase/migrations/**tomainapplies it to the hosted Supabase project with no manual step.deploy.ymlheader comment alongside the existing*_DATABASE_URLentries.