assessment-model/drizzle.config.ts
Daniel Roth 6f9097d293 Fix drizzle-kit schema glob and generate Projects migration
drizzle-kit recurses the schema directory and tries to compile every
file as JS/TS. The new projects/schema.md broke generation with a
SyntaxError. Narrow the glob to *.ts so docs can live alongside schema.

Generate migration 0273 for the Projects module: 11 new tables, the
three nullable uploaded_files FK columns, and the new "projects"
file_source enum value.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 15:36:08 +00:00

22 lines
659 B
TypeScript

import * as dotenv from "dotenv";
import type { Config } from "drizzle-kit";
dotenv.config({ path: ".env.local" });
const isProduction = process.env.VERCEL_ENV === "production";
export default {
schema: "./src/app/db/schema/**/*.ts",
out: "./src/app/db/migrations",
dialect: "postgresql",
dbCredentials: {
host: process.env.DB_HOST!,
port: Number(process.env.DB_PORT!),
user: process.env.DB_USERNAME!,
password: process.env.DB_PASSWORD!,
database: process.env.DB_NAME!,
ssl: isProduction
? true // strict SSL for prod
: { rejectUnauthorized: false }, // allow self-signed in dev/preview
},
} satisfies Config;