Skip to content

fix(db): restore 0039 migration journal reference#503

Merged
jahooma merged 1 commit intomainfrom
aether/fix-e2e-db-migration-b433
Apr 15, 2026
Merged

fix(db): restore 0039 migration journal reference#503
jahooma merged 1 commit intomainfrom
aether/fix-e2e-db-migration-b433

Conversation

@aether-agent
Copy link
Copy Markdown
Contributor

@aether-agent aether-agent bot commented Apr 15, 2026

Summary

  • restore the 0039 migration journal tag to 0039_quiet_franklin_storm, which matches the checked-in SQL migration file
  • leave the existing migration files untouched and fix the metadata drift that broke Drizzle's migration lookup

Validation

  • bun install
  • bun run --cwd packages/internal db:e2e:down
  • bun run --cwd packages/internal db:e2e:setup
  • bun run --cwd packages/internal db:e2e:down

Notes

  • The broken tag 0039_bumpy_vertigo appears to have been introduced later than the original 0039_quiet_franklin_storm migration and did not correspond to any file on disk.
  • Installing dependencies was required before the Bun-based setup script would run successfully in this environment.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 15, 2026

Greptile Summary

This PR fixes a metadata drift in Drizzle's migration journal by restoring the entry for migration index 39 from the non-existent tag 0039_bumpy_vertigo back to 0039_quiet_franklin_storm, which correctly matches the SQL file checked into the repository.

  • The broken tag 0039_bumpy_vertigo had no corresponding .sql file, causing Drizzle's migration runner to fail when looking up or applying this migration.
  • The correct file 0039_quiet_franklin_storm.sql (adds referral_legacy enum value + is_legacy column) was originally introduced in commit 57a01891 with this exact tag before a later commit inadvertently overwrote the journal reference.
  • The fix is a single-character-minimal change with no schema or SQL modifications — only the journal metadata is touched.
  • Note for follow-up: packages/internal/src/db/migrations/0039_automatic_updated_at.sql exists on disk (added in 2c423c3b) but has no corresponding journal entry. While this is a pre-existing issue outside the scope of this PR, Drizzle will silently ignore it. It should be cleaned up or added to the journal as a tracked migration to avoid future confusion.

Confidence Score: 5/5

Safe to merge — single-field metadata fix with no schema changes and a clear paper trail in git history.

The change is minimal (one string value in a JSON file), well-justified by the git history showing the original correct tag, and directly unblocks Drizzle's migration runner. The SQL file it now points to is correct and already on disk. There are no logic, security, or data-integrity concerns introduced by this PR.

No files require special attention. As a follow-up outside this PR, 0039_automatic_updated_at.sql is an unreferenced migration file on disk that should be cleaned up or journaled.

Important Files Changed

Filename Overview
packages/internal/src/db/migrations/meta/_journal.json Single-line tag fix: restores 0039_bumpy_vertigo0039_quiet_franklin_storm to match the actual SQL file present on disk; change is correct and consistent with the commit that originally introduced the migration.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Drizzle migration runner] --> B{Read _journal.json}
    B --> C[Look for idx=39 tag]
    C -- "Before PR\n0039_bumpy_vertigo" --> D[❌ No matching .sql file\nMigration lookup fails]
    C -- "After PR\n0039_quiet_franklin_storm" --> E[✅ Matches 0039_quiet_franklin_storm.sql\nMigration runs successfully]
    E --> F[Apply: ADD enum value 'referral_legacy'\n+ ADD COLUMN is_legacy]
Loading

Reviews (1): Last reviewed commit: "fix(db): restore 0039 migration journal ..." | Re-trigger Greptile

@jahooma jahooma merged commit 4aff91f into main Apr 15, 2026
34 checks passed
@jahooma jahooma deleted the aether/fix-e2e-db-migration-b433 branch April 15, 2026 02:23
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