Testing Migrations

This commit is contained in:
Max committed 2026-11-03 12:53:17 -07:00
1 parent d9abeb7fb1
commit 9804771a5b
8 files changed
+1109

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
//
// 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,
},
}