feat(14-01): rewrite database foundation from SQLite to PostgreSQL

- Replace all 13 sqliteTable definitions with pgTable (pg-core)
- Convert integer timestamps to native timestamp type with defaultNow()
- Convert real columns to doublePrecision, integer used to boolean
- Rewrite db connection to use postgres.js driver with DATABASE_URL
- Rewrite migrate.ts to use postgres-js migrator targeting drizzle-pg/
- Convert seed.ts to async
- Update drizzle.config.ts to postgresql dialect
- Install postgres and @electric-sql/pglite, remove better-sqlite3
This commit is contained in:
2026-04-04 12:17:05 +02:00
parent f7048a267a
commit 3724cf8348
7 changed files with 90 additions and 105 deletions

View File

@@ -21,12 +21,10 @@
"@tanstack/react-query-devtools": "^5.91.3",
"@tanstack/react-router-devtools": "^1.166.7",
"@tanstack/router-plugin": "^1.166.9",
"@types/better-sqlite3": "^7.6.13",
"@types/bun": "latest",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.1",
"better-sqlite3": "^12.8.0",
"concurrently": "^9.1.2",
"drizzle-kit": "^0.31.9",
"vite": "^8.0.0"
@@ -35,6 +33,7 @@
"typescript": "^5.9.3"
},
"dependencies": {
"@electric-sql/pglite": "^0.4.3",
"@hono/zod-validator": "^0.7.6",
"@modelcontextprotocol/sdk": "^1.29.0",
"@tailwindcss/vite": "^4.2.1",
@@ -45,6 +44,7 @@
"framer-motion": "^12.38.0",
"hono": "^4.12.8",
"lucide-react": "^0.577.0",
"postgres": "^3.4.8",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"recharts": "^3.8.0",