Skip to content

refactor(engine): add inserted_at_date to v1_payload - #4899

Closed
mrkaye97 wants to merge 5 commits into
mainfrom
mk/add-inserted-at-date-to-payloads
Closed

mrkaye97 wants to merge 5 commits into
mainfrom
mk/add-inserted-at-date-to-payloads

Conversation

@mrkaye97

@mrkaye97 mrkaye97 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Description

The plan here is to prepare to re-partition v1_payload and update its PK to use inserted_at_date, so we can enforce a more genuine "unique" constraint on (external_id, inserted_at_date) (which is extremely unlikely to collide by chance.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking changes to code which doesn't change any behaviour)

Checklist

Changes have been:

  • Documented (where applicable)
  • Added to CHANGELOG (where applicable) -- see Keep a Changelog

🤖 AI Disclosure
  • I acknowledge that an LLM was used in the creation of this Pull Request, in accordance with Hatchet's AI_POLICY.md.
  • Details: Claude to write the if/else logic in the migration since I never remember how to do that

@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
hatchet-docs Ready Ready Preview Sep 5, 2026 5:26pm UTC

Request Review

@github-actions github-actions Bot added the engine Related to the core Hatchet engine label Sep 5, 2026
@greptile-apps

greptile-apps Bot commented Sep 5, 2026

Copy link
Copy Markdown

Greptile Summary

Adds and backfills v1_payload.inserted_at_date in preparation for date-aware partitioning and uniqueness.

  • Introduces a resumable, non-transactional batched backfill and then enforces NOT NULL.
  • Populates the date from inserted_at for new payload writes.
  • Updates the schema and generated sqlc model/read mappings for the new column.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or non-blocking defects identified.

The migration's rerun behavior is coherent, current writes derive the new value from inserted_at, and the generated model, SELECT order, scan destinations, and INSERT columns remain consistent.

Reviews (1): Last reviewed commit: "feat: wire up writes" | Re-trigger Greptile

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ Optional test failure: The load-online-migrate job failed on this PR. This check is non-mandatory and does not block merging, but may be worth investigating. View logs

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ Optional test failure: The load-online-migrate job failed on this PR. This check is non-mandatory and does not block merging, but may be worth investigating. View logs

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ Optional test failure: The load-online-migrate job failed on this PR. This check is non-mandatory and does not block merging, but may be worth investigating. View logs

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ Optional test failure: The load-online-migrate job failed on this PR. This check is non-mandatory and does not block merging, but may be worth investigating. View logs

@mrkaye97 mrkaye97 closed this Sep 21, 2026

This branch was successfully deployed

1 active deployment
Preview 560772e3 Deployed Sep 5, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine Related to the core Hatchet engine sdk-py Related to the Python sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant