Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
17 changes: 11 additions & 6 deletions prisma.config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
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
* `schema.prisma` and into this config file. The application runtime
* 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 } } : {}),
});