🧑💻 Exit prisma command if database url starts with "postgres://"
Closes #602
This commit is contained in:
@ -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) => {
|
||||
|
Reference in New Issue
Block a user