@@ -29,15 +29,18 @@ export const executePrismaCommand = (command: string, options?: Options) => {
|
|||||||
executeCommand(`${command} --schema ${mysqlSchemaPath}`)
|
executeCommand(`${command} --schema ${mysqlSchemaPath}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (databaseUrl?.startsWith('postgres')) {
|
if (
|
||||||
|
databaseUrl?.startsWith('postgres://') ||
|
||||||
|
databaseUrl?.startsWith('postgresql://')
|
||||||
|
) {
|
||||||
console.log('Executing for PostgreSQL schema')
|
console.log('Executing for PostgreSQL schema')
|
||||||
executeCommand(`${command} --schema ${postgesqlSchemaPath}`)
|
executeCommand(`${command} --schema ${postgesqlSchemaPath}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (process.env.DATABASE_URL?.startsWith('postgres://')) {
|
console.error(
|
||||||
console.error('PostgreSQL `DATABASE_URL` should start with postgresql://')
|
'Invalid `DATABASE_URL` format, it should start with `postgresql://` or `postgres://`'
|
||||||
process.exit(1)
|
)
|
||||||
}
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const executeCommand = (command: string) => {
|
const executeCommand = (command: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user