import "dotenv/config";
import { defineConfig } from "drizzle-kit";

/**
 * Migrationer genereras till infrastructure/migrations (spec §49) och körs
 * med `pnpm db:migrate`. Ingen destruktiv ändring utan backup + rollback (spec §63).
 */
export default defineConfig({
  dialect: "postgresql",
  schema: "./src/schema/index.ts",
  out: "../../infrastructure/migrations",
  casing: "snake_case",
  dbCredentials: {
    url: process.env.DATABASE_URL ?? "postgres://app_user:app_dev_password@localhost:5432/app",
  },
  strict: true,
  verbose: true,
});
