20 lines
569 B
TypeScript
20 lines
569 B
TypeScript
import type { Config } from 'drizzle-kit';
|
|
import 'dotenv/config';
|
|
const url = process.env.DATABASE_URL || 'storage/browser-helper/data.sqlite3';
|
|
// Ensure the directory exists
|
|
import fs from "node:fs";
|
|
import path from "node:path";
|
|
const dir = path.dirname(url);
|
|
if (!fs.existsSync(dir)) {
|
|
fs.mkdirSync(dir, { recursive: true });
|
|
}
|
|
|
|
export default {
|
|
schema: './src/db/schema.ts',
|
|
out: './storage/browser-helper/drizzle',
|
|
dialect: 'sqlite',
|
|
dbCredentials: {
|
|
url: process.env.DATABASE_URL || 'storage/browser-helper/data.sqlite3',
|
|
},
|
|
} satisfies Config;
|