mirror of
https://github.com/hanzoai/sign.git
synced 2026-10-21 01:21:51 +00:00
prisma generate loads prisma.config.ts, and env() throws when DATABASE_URL is unset, so every build without a database stopped at prebuild. generate needs no database; migrate still refuses an empty URL. Claude-Session: https://claude.ai/code/session_01TUxvfuta1Z44KVNYuAz71F
26 lines
1002 B
TypeScript
26 lines
1002 B
TypeScript
import { defineConfig } from 'prisma/config';
|
|
|
|
// Where the CLI finds the schema, the migrations and the database.
|
|
//
|
|
// Prisma 7 took the connection URL out of schema.prisma: the schema says WHAT
|
|
// the store is (sqlite), this file says WHERE it is for the tools that need to
|
|
// reach it — migrate, studio, db seed. The running app does not read this; it
|
|
// hands the client a driver adapter built from the same `DATABASE_URL`
|
|
// (./index.ts), so there is one variable and two readers, never two URLs.
|
|
//
|
|
// The seed command moved here with it: the `prisma` block in package.json is no
|
|
// longer read.
|
|
export default defineConfig({
|
|
schema: 'schema.prisma',
|
|
migrations: {
|
|
path: 'migrations',
|
|
seed: 'tsx ./seed-database.ts',
|
|
},
|
|
// Read, not required: `prisma generate` loads this file and needs no database,
|
|
// so the image and the gate build without one. migrate and studio still refuse
|
|
// to run on an empty URL.
|
|
datasource: {
|
|
url: process.env.DATABASE_URL ?? '',
|
|
},
|
|
});
|