fix(db): 修正 drizzle-kit 在 Bun SQLite 下的配置与脚本

This commit is contained in:
2026-03-05 16:59:25 +08:00
parent b1062a5aed
commit 46e2c94faf
2 changed files with 7 additions and 6 deletions

View File

@@ -1,11 +1,12 @@
import { defineConfig } from 'drizzle-kit'
import { env } from '@/env'
const databasePath = process.env.DATABASE_PATH ?? 'data.db'
export default defineConfig({
out: './drizzle',
schema: './src/server/db/schema/index.ts',
dialect: 'sqlite',
dbCredentials: {
url: env.DATABASE_PATH,
url: databasePath,
},
})

View File

@@ -14,10 +14,10 @@
"compile:linux:x64": "bun compile.ts --target bun-linux-x64",
"compile:windows": "bun run compile:windows:x64",
"compile:windows:x64": "bun compile.ts --target bun-windows-x64",
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate",
"db:push": "drizzle-kit push",
"db:studio": "drizzle-kit studio",
"db:generate": "bun --bun drizzle-kit generate",
"db:migrate": "bun --bun drizzle-kit migrate",
"db:push": "bun --bun drizzle-kit push",
"db:studio": "bun --bun drizzle-kit studio",
"dev": "bunx --bun vite dev",
"fix": "biome check --write",
"typecheck": "tsc --noEmit"