Skip to content

Add missing drizzle snapshot - #255

Open
Akeeru wants to merge 2 commits into
javedh-dev:devfrom
Akeeru:fix/database-snapshot
Open

Add missing drizzle snapshot#255
Akeeru wants to merge 2 commits into
javedh-dev:devfrom
Akeeru:fix/database-snapshot

Conversation

@Akeeru

@Akeeru Akeeru commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

The compliance-documents migration series (20260804073000_fix_notification_key_unique_index through 20260804090200_drop_insurance_pucc_tables) was committed to src/server/db/migrations and registered in _journal.json, but no matching snapshot was added to migrations/meta. The newest snapshot on dev was still
20260801044257_snapshot.json, which describes the pre-migration schema (insurances / puccs tables, no compliance_documents).

Because Drizzle diffs the current schema against the latest snapshot, pnpm db:generate would compute the diff from a stale baseline and emit a migration that re-creates insurances/puccs and drops compliance_documents — corrupting the migration chain for anyone generating a new migration.

Changes

  • Add src/server/db/migrations/meta/20260804090200_snapshot.json, matching the final journal entry (idx: 21, 20260804090200_drop_insurance_pucc_tables).
    • compliance_documents present
    • insurances / puccs removed
  • Formatted the snapshot to match repository Prettier config.

No schema, migration SQL, or application code was changed — snapshot metadata only.

Verification

  • pnpm check — passes
  • pnpm lint — passes
  • pnpm db:generate on a clean checkout now produces no spurious migration
  • pnpm db:migrate on a fresh database applies the full chain and ends with compliance_documents in place

Risk

Low. Snapshot files are only consumed by the Drizzle Kit generator; they are not executed at runtime and do not affect existing deployments.

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