Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing --shadow-database-url for keystone migrate #9117

Merged
merged 1 commit into from
Apr 29, 2024
Merged
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
9 changes: 7 additions & 2 deletions packages/core/src/scripts/migrate.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import esbuild from 'esbuild'
import fse from 'fs-extra'
import { join } from 'node:path'
import { spawn } from 'node:child_process'

import esbuild from 'esbuild'

import {
createSystem,
getBuiltKeystoneConfiguration
Expand Down Expand Up @@ -77,6 +76,9 @@ provider = ${system.config.db.provider}`)
const paths = system.getPaths(cwd)
const { output: summary, exitCode: prismaExitCode } = await spawnPrisma(cwd, system, [
'migrate', 'diff',
...(system.config.db.shadowDatabaseUrl ? [
'--shadow-database-url', system.config.db.shadowDatabaseUrl
] : []),
'--from-migrations', 'migrations/',
'--to-schema-datamodel', paths.schema.prisma,
])
Expand All @@ -94,6 +96,9 @@ provider = ${system.config.db.provider}`)
console.log(summary)
const { output: sql, exitCode: prismaExitCode2 } = await spawnPrisma(cwd, system, [
'migrate', 'diff',
...(system.config.db.shadowDatabaseUrl ? [
'--shadow-database-url', system.config.db.shadowDatabaseUrl
] : []),
'--from-migrations', 'migrations/',
'--to-schema-datamodel', paths.schema.prisma,
'--script'
Expand Down