Skip to content

Migrate backend database layer to Drizzle#25

Merged
jakebodea merged 1 commit into
mainfrom
codex/drizzle-backend
May 23, 2026
Merged

Migrate backend database layer to Drizzle#25
jakebodea merged 1 commit into
mainfrom
codex/drizzle-backend

Conversation

@jakebodea
Copy link
Copy Markdown
Owner

@jakebodea jakebodea commented May 23, 2026

Summary

  • add Drizzle schema, client, config, baseline migration metadata, and seed entrypoint
  • switch Better Auth and app-owned database access from direct pg/Kysely wiring to Drizzle
  • convert the Planning Center identity backfill script to TypeScript/Drizzle and document database workflows
  • standardize the repo on Bun by removing package-lock.json and ignoring future npm lockfiles
  • pin Turbopack to the repo root and make admin raw-SQL timestamp mapping handle Date/string driver shapes

Behavior changes

  • Better Auth now uses the built-in Drizzle adapter against the shared Drizzle client.
  • Drizzle owns database migrations, including Better Auth tables and app-owned tables.
  • The baseline migration is intentionally idempotent for adopting existing databases.

Verification

  • bun run typecheck
  • bun run lint
  • bun run test
  • bunx drizzle-kit check --config drizzle.config.ts
  • bun run build
  • bun --env-file=.env.local run db:migrate
  • bun run db:migrate
  • curl -i http://localhost:3000/admin returned 200 after clearing .next/dev and restarting dev

Notes

  • I ran the migration against the configured local .env.local database and reran it through the normal package script after making Drizzle config load .env.local.
  • Please still inspect the prod DB state before applying this in production.
  • The Next parent-lockfile warning is gone after pinning turbopack.root to the repo directory.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

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

Project Deployment Actions Updated (UTC)
worship-admin Ready Ready Preview, Comment May 23, 2026 9:39pm

@jakebodea jakebodea force-pushed the codex/drizzle-backend branch from 0661dc5 to 509bb91 Compare May 23, 2026 21:38
@jakebodea jakebodea merged commit e34230c into main May 23, 2026
4 checks passed
@jakebodea jakebodea deleted the codex/drizzle-backend branch May 23, 2026 21:41
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