From 3ea0ff6b814d363583db6047273c4cb32e089e81 Mon Sep 17 00:00:00 2001 From: Mythie Date: Fri, 25 Aug 2023 17:51:58 +1000 Subject: [PATCH] chore: support direct urls for prisma --- .env.example | 2 ++ packages/prisma/schema.prisma | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index afeb90343..cfa96f59b 100644 --- a/.env.example +++ b/.env.example @@ -12,6 +12,8 @@ NEXT_PUBLIC_APP_URL="http://localhost:3000" # [[DATABASE]] NEXT_PRIVATE_DATABASE_URL="postgres://documenso:password@127.0.0.1:54320/documenso" +# Defines the URL to use for the database when running migrations and other commands that won't work with a connection pool. +NEXT_PRIVATE_DIRECT_DATABASE_URL="postgres://documenso:password@127.0.0.1:54320/documenso" # [[SMTP]] # OPTIONAL: Defines the transport to use for sending emails. Available options: smtp-auth (default) | smtp-api | mailchannels diff --git a/packages/prisma/schema.prisma b/packages/prisma/schema.prisma index 65e4e8b63..8e4ff31f0 100644 --- a/packages/prisma/schema.prisma +++ b/packages/prisma/schema.prisma @@ -1,11 +1,11 @@ generator client { - provider = "prisma-client-js" - previewFeatures = ["extendedWhereUnique"] + provider = "prisma-client-js" } datasource db { - provider = "postgresql" - url = env("NEXT_PRIVATE_DATABASE_URL") + provider = "postgresql" + url = env("NEXT_PRIVATE_DATABASE_URL") + directUrl = env("NEXT_PRIVATE_DIRECT_DATABASE_URL") } enum IdentityProvider {