33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
//
|
|
// Prisma CLI configuration.
|
|
//
|
|
// Prisma 7 removed `url` from the datasource block in schema.prisma; the
|
|
// connection string for migrations lives here instead.
|
|
//
|
|
// This file configures the CLI only. The running server does not use Prisma --
|
|
// it talks to MariaDB through server/config/database.js (mysql2) with raw SQL.
|
|
// Prisma is a development and admin tool here, for schema migrations and
|
|
// scaffolding.
|
|
//
|
|
// DATABASE_URL must point at an account with DDL rights. In dev that is the
|
|
// root user exported by shell.nix; in production migrateDatabase.sh composes it
|
|
// from the admin credentials in ~/.env. It must NEVER be the least-privilege
|
|
// `app` account the server runs as, which deliberately holds no CREATE/ALTER.
|
|
//
|
|
// .mjs rather than .js because this project is CommonJS and Prisma's example
|
|
// config is ESM; the explicit extension avoids any ambiguity.
|
|
//
|
|
export default {
|
|
schema: 'prisma/schema.prisma',
|
|
|
|
migrations: {
|
|
path: 'prisma/migrations',
|
|
},
|
|
|
|
datasource: {
|
|
// process.env directly rather than env() -- the helper throws when the
|
|
// variable is unset, which makes the failure harder to read.
|
|
url: process.env.DATABASE_URL,
|
|
},
|
|
}
|