Conversation
Schema (closes #1): - All 13 tables: sqliteTable() → pgTable() - integer({mode: 🔮 View transcript: https://agentlogs.chsprc.com/s/bwgzcefdb8jizsaurae83j2s"boolean"}) → boolean() - integer({mode:"timestamp"}) → timestamp({withTimezone, mode:"date"}) - real() → doublePrecision() - .default(sql`unixepoch(...)`) → .defaultNow() - Move better-sqlite3 from deps to devDeps, add postgres Driver & config (closes #2): - db/index.ts: better-sqlite3 → postgres.js, DB_PATH → DATABASE_URL - drizzle.config.ts: dialect sqlite → postgresql - auth.ts: provider sqlite → pg Queries (closes #3): - DATE(col,'unixepoch') → col::date - STRFTIME → TO_CHAR for hourly grouping - Remove Math.floor(ms/1000) unix conversions, pass Date objects - db.$client.prepare().get() → await db.execute(sql`...`) - Remove PRAGMA foreign_keys = ON Migration runner (closes #4): - Rewrite migrate.mjs to use Drizzle's built-in postgres migrator - Delete old SQLite migrations, generate fresh Postgres baseline Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tomjnsn
added a commit
that referenced
this pull request
Feb 24, 2026
Schema (closes #1): - All 13 tables: sqliteTable() → pgTable() - integer({mode: 🔮 View transcript: https://agentlogs.chsprc.com/s/bwgzcefdb8jizsaurae83j2s"boolean"}) → boolean() - integer({mode:"timestamp"}) → timestamp({withTimezone, mode:"date"}) - real() → doublePrecision() - .default(sql`unixepoch(...)`) → .defaultNow() - Move better-sqlite3 from deps to devDeps, add postgres Driver & config (closes #2): - db/index.ts: better-sqlite3 → postgres.js, DB_PATH → DATABASE_URL - drizzle.config.ts: dialect sqlite → postgresql - auth.ts: provider sqlite → pg Queries (closes #3): - DATE(col,'unixepoch') → col::date - STRFTIME → TO_CHAR for hourly grouping - Remove Math.floor(ms/1000) unix conversions, pass Date objects - db.$client.prepare().get() → await db.execute(sql`...`) - Remove PRAGMA foreign_keys = ON Migration runner (closes #4): - Rewrite migrate.mjs to use Drizzle's built-in postgres migrator - Delete old SQLite migrations, generate fresh Postgres baseline Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
sqliteTable()topgTable()with proper column type mappings (boolean, timestamp, doublePrecision)better-sqlite3+drizzle-orm/better-sqlite3withpostgres+drizzle-orm/postgres-jsDATE(col,'unixepoch'),STRFTIME,PRAGMA, raw prepared statements) to PostgreSQL equivalentsCloses #1, closes #2, closes #3, closes #4
Test plan
bun run checkpasses (format, lint, type check)bun run --filter packages/web db:migrate— applies cleanlybun run --filter packages/web dev— app starts, can login, create transcripts🤖 Generated with Claude Code