Skip to content

migrate/supabase: accept the jobname/schedule/command pg_cron dump the docs prescribe (conformance M2) - #312

Merged
Sorcecoder merged 2 commits into
mainfrom
fix/m2-migrate-cron-dump
Sep 1, 2026
Merged

Sorcecoder merged 2 commits into
mainfrom
fix/m2-migrate-cron-dump

Conversation

@Sorcecoder

Copy link
Copy Markdown
Contributor

Docs↔codegen conformance sweep. 19-migrate-supabase.md:31 promises pg_cron jobs arrive as cron.schedule() calls or a jobname/schedule/command dump, and gives the concrete \\copy (select jobname, schedule, command from cron.job) to stdout recipe — which emits TAB-separated rows. The migrator only parsed the SQL call form, so following the manual literally produced a blocking cron_job gap and zero jobs[].

Fix: a dump-row detector (TAB-only split into exactly 3 fields, not a cron.schedule( line — exact because COPY TEXT escapes real tabs/newlines) feeding a shared emit_job() lifted verbatim from the call path, so both forms share one schedule check. A hand-added header is skipped; an empty/\\N field is a blocking gap (never guess). Consumed rows are blanked, not removed, so the SQL pass keeps its cron.sql:N line numbers. cron.schedule() output is byte-identical incl. line numbers. Verified against a live Postgres that the doc's recipe emits clean rows (no COPY n tag), so the doc needs no change.

Test: the_prescribed_cron_job_dump_yields_the_same_job_as_the_cron_schedule_call. 586 lib tests pass. No version bump.

Sorcecoder and others added 2 commits September 1, 2026 22:24
…e docs prescribe, not only cron.schedule() (M2)

docs/ai/19-migrate-supabase.md tells users to export pg_cron with a psql \copy of jobname/schedule/command, which emits TAB-separated rows. cronmap only read cron.schedule() calls, so following the manual literally produced a blocking cron_job gap and an empty jobs[].

build_jobs now runs a line pass first: a non-cron.schedule line that splits into exactly three TAB-separated fields is a dump row. Consumed rows are blanked, not removed, so the SQL pass keeps reporting the same cron.sql line numbers. Both forms funnel into one emit_job, so the schedule check, snake_casing and body gap are shared, and the cron.schedule() path is unchanged.

A hand-added header row is skipped; an empty or \N jobname/schedule/command is a blocking cron_job gap rather than a guess.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant