diff --git a/packages/prisma/scripts/executeCommand.ts b/packages/prisma/scripts/executeCommand.ts index f0be4a775..c91288423 100644 --- a/packages/prisma/scripts/executeCommand.ts +++ b/packages/prisma/scripts/executeCommand.ts @@ -26,7 +26,7 @@ export const executePrismaCommand = (command: string, options?: Options) => { if (!databaseUrl) { console.error('Could not find DATABASE_URL in environment') - return + process.exit(1) } if (databaseUrl?.startsWith('mysql://')) { @@ -38,6 +38,11 @@ export const executePrismaCommand = (command: string, options?: Options) => { console.log('Executing for PostgreSQL schema') executeCommand(`${command} --schema ${postgesqlSchemaPath}`) } + + if (process.env.DATABASE_URL?.startsWith('postgres://')) { + console.error('PostgreSQL `DATABASE_URL` should start with postgresql://') + process.exit(1) + } } const executeCommand = (command: string) => {