diff --git a/package.json b/package.json index d707ced..5ff4b6e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "temlet", - "version": "0.1.0", + "version": "0.3.0", "description": "Self-hosted video rendering and upload management for After Effects projects — render with nexrender, auto-generate metadata, and schedule uploads to YouTube and TikTok.", "type": "module", "license": "MIT", diff --git a/prisma.config.ts b/prisma.config.ts index d8bc87f..b5ac686 100644 --- a/prisma.config.ts +++ b/prisma.config.ts @@ -1,5 +1,5 @@ import path from 'node:path'; -import { defineConfig, env } from 'prisma/config'; +import { defineConfig } from 'prisma/config'; /** * Prisma 7 moved the Migrate/introspection connection URL out of @@ -7,13 +7,18 @@ import { defineConfig, env } from 'prisma/config'; * connects via a pg driver adapter (see `lib/prisma.ts`); this datasource * block is only used by Prisma CLI commands (migrate, db pull, studio). * - * `DATABASE_URL` is provided by the environment (`.env` in dev, CI secret in - * CI). Prisma 7 no longer auto-loads `.env`, so populate the shell env (or use + * The datasource is attached only when `DATABASE_URL` is present. This keeps + * `prisma generate` (which needs no DB) working in environments where the + * variable is unset — notably the Docker image build. Migrate/introspection + * commands require a real URL and will have it set. Using `process.env` + * instead of Prisma's `env()` helper avoids its eager throw on a missing var. + * + * Prisma 7 no longer auto-loads `.env`, so populate the shell env (or use * `dotenv -e .env -- prisma ...`) when running migrations locally. */ +const databaseUrl = process.env.DATABASE_URL; + export default defineConfig({ schema: path.join('prisma', 'schema.prisma'), - datasource: { - url: env('DATABASE_URL'), - }, + ...(databaseUrl ? { datasource: { url: databaseUrl } } : {}), });