feat(migrations): Unify schema and data journals#896
Draft
dcramer wants to merge 16 commits into
Draft
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
force-pushed
the
codex/unified-migration-journals
branch
from
July 16, 2026 19:09
fd37ff2 to
e763a82
Compare
dcramer
force-pushed
the
codex/unified-migration-journals
branch
from
July 23, 2026 02:55
4ca01d1 to
b44fc6a
Compare
dcramer
force-pushed
the
codex/unified-migration-journals
branch
from
July 23, 2026 05:17
b44fc6a to
1df1dca
Compare
dcramer
force-pushed
the
codex/unified-migration-journals
branch
from
July 23, 2026 05:36
f76f32e to
0cac003
Compare
dcramer
force-pushed
the
codex/unified-migration-journals
branch
from
July 23, 2026 15:27
d1fa530 to
64ff6a4
Compare
Add a publishable migration package that executes SQL and TypeScript entries from one Drizzle-compatible journal. Route core and plugin upgrades through the shared runner so schema changes and resumable data migrations use one ordered ledger. Keep historical scripts isolated behind versioned capabilities, and wire the package into release, CI, Craft, documentation, and package validation. Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Remove the migration task registry and keep historical data migration code in each journal entry. This prevents future runtime refactors or deletions from breaking pending upgrades. Expose versioned migration capabilities, move scheduler and core backfills into their migration files, and update migration tests and documentation. Co-Authored-By: GPT-5.6 Codex <noreply@openai.com>
Expose the exact host database adapter through MigrationContextV1 instead of reconstructing a partial SQL capability. Rebuild the SQL-heavy frozen migrations without connection setup and driver implementations so migrations retain transformation logic without duplicating database infrastructure. Co-Authored-By: GPT-5.6 Codex <noreply@openai.com>
Allow migrations to import append-only infrastructure helpers from @sentry/junior/migration-helpers/v1 while continuing to reject unversioned Junior runtime imports. Keep one-off Redis transformations and backfill decisions in their journal entries, replace generated capsules for migrations 0004 through 0006 with readable source, and publish explicit helper types without private module references. Co-Authored-By: GPT-5.6 Codex <noreply@openai.com>
Rebase the mixed journal onto the latest schema, move the new conversation usage repair into the journal, and preserve its focused tests. Remove unchanged Drizzle snapshots for data entries, rebuild the legacy history migration around versioned infrastructure helpers, and reject runtime re-export bypasses. Co-Authored-By: GPT-5.6 Codex <noreply@openai.com>
Freeze complete scheduler migration schemas, repair malformed existing scheduler rows, and add focused regression coverage. Harden migration path and JSON boundaries, narrow the runner-only locking interface, remove dead helper surface, deduplicate state projection, and preserve original migration errors. Co-Authored-By: GPT-5.6 Codex <noreply@openai.com>
Require explicit schema-bootstrap execution, scope plugin migration state by default while preserving historical plugin keys, and document permanent helper-version compatibility. Add real PostgreSQL progress, resume, and lock serialization contracts plus host-wiring isolation coverage. Co-Authored-By: GPT-5.6 Codex <noreply@openai.com>
Pass the real core state adapter into TypeScript migrations so Redis-native index and lock detection continues to work. Add multiline import guard coverage and remove the stale generated temp-path comment from the history migration. Co-Authored-By: GPT-5.6 Codex <noreply@openai.com>
Drop the retired core and plugin data migration capsules after the bridge-release cutover. Keep mixed journal support for future entries while preserving the current core SQL ledger and upgrade guard.
Require callers to select full migration or schema-bootstrap mode explicitly. Resolve the state context only when a pending TypeScript migration runs, so SQL-only upgrades do not depend on Redis. Align the migrations package with the current lockstep release version.
Show when to use schema versus data migrations, the generation commands, generated file shapes, and the checks required before committing.
Serialize PGlite migration runs outside database transactions so data migration checkpoints and failure state survive an interrupted run.
Pass the explicit schema-bootstrap mode in SQL tests added on main after the migration helper became mode-aware.
Allow edited failed data migrations to restart with clean progress while keeping completed entries immutable. Avoid import-guard false positives, honor generator output overrides, and align the package version with the current release.
Allow edited TypeScript migrations to recover from stale running rows once the migration lock is reacquired. Pass the host Redis capability into plugin data migrations and cover both paths with tests.
dcramer
force-pushed
the
codex/unified-migration-journals
branch
from
July 24, 2026 16:02
5a93cff to
4e924d7
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4e924d7. Configure here.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4e924d7. Configure here.
Mask comments before validating static, side-effect, and dynamic module loads so documentation examples do not block migration authoring.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Junior can now run SQL schema migrations and TypeScript data migrations from
the same Drizzle journal.
junior upgraderuns both kinds in order. The currentjournals remain SQL-only; this adds the path for future data migrations without
bringing back the retired migration code.
For a schema change, update the owning Drizzle schema and run:
That generates a normal
<tag>.sqlmigration and a Drizzle snapshot.For a data migration, run:
That adds a
<tag>.tsentry to the same journal:Use schema migrations for tables, columns, indexes, and simple same-database
backfills. Use data migrations when the work needs application code, state,
Redis, or resumable progress. Plugin packages use the same commands with their
own package name.
The maintainer workflow is documented in
Database Migrations.
Existing databases without core Drizzle history still use the documented
0.107.1bridge before upgrading.