R1-A: Migration 0010 is back to its round-2 content, the ALTER TABLE only, since a database that already applied 0010 never runs it again. The repair that writes revision 0 into ground_dinner job payloads without one is now migration 0011, applied by the same boot Migrate call, so before the job runner starts and before FailInterruptedGroundings. TestUpgradeKeepsLegacyQueuedGrounding now upgrades from 0009 and from a database with 0010 already recorded, each with a pending Regular and a queued legacy job; both keep the dinner pending through the boot cleanup and then ground it. R2-A: The boot cleanup no longer fails archived dinners. Archiving stops a running job and leaves the dinner pending, which the cleanup relabelled failed with interrupted. TestRestartKeepsArchivedPendingDinner archives a pending Regular while its job runs and checks the cleanup leaves it pending with no error. Maestro task 5037ff86-181d-448e-927b-c2fd2258a25d. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 lines
446 B
SQL
8 lines
446 B
SQL
-- 0010_dinner_grounding_revision: each ground_dinner job carries the
|
|
-- dinner's grounding_revision when it was enqueued, and records its result
|
|
-- only while the dinner still has that revision. Renaming a pending dinner
|
|
-- raises the revision before enqueuing the job for the new name, so an
|
|
-- earlier job — queued or running — can no longer write the dinner.
|
|
|
|
ALTER TABLE dinners ADD COLUMN grounding_revision INTEGER NOT NULL DEFAULT 0;
|