Open History to see the last commit
1import { config } from 'dotenv'
2import { defineConfig } from 'drizzle-kit'
3
4config({ path: ['.env.local', '.env'] })
5
6// The d1-http driver targets the *remote* D1 database (db:push, db:studio);
7// the credentials are only required for those commands. Local development
8// applies generated migrations to wrangler's local D1 instead:
9// bun run db:generate && bun run db:migrate
10export default defineConfig({
11 out: './drizzle',
12 schema: './src/db/schema.ts',
13 dialect: 'sqlite',
14 driver: 'd1-http',
15 dbCredentials: {
16 accountId: process.env.CLOUDFLARE_ACCOUNT_ID ?? '',
17 databaseId: process.env.CLOUDFLARE_DATABASE_ID ?? '',
18 token: process.env.CLOUDFLARE_D1_TOKEN ?? '',
19 },
20})