Skip to content

Commit f560b7b

Browse files
fix: remove --skip-generate flag from prisma db push (removed in Prisma 7)
Prisma 7 removed the --skip-generate flag from 'prisma db push'. This caused the testcontainers migration command to fail silently (tinyexec swallows the error), resulting in empty databases and 'table does not exist' errors in tests. Also added --url flag to pass the connection string directly to the CLI, ensuring the correct URL is used regardless of config file resolution. Co-Authored-By: Eric Allam <eallam@icloud.com>
1 parent 6c5d959 commit f560b7b

File tree

1 file changed

+2
-1
lines changed
  • internal-packages/testcontainers/src

1 file changed

+2
-1
lines changed

internal-packages/testcontainers/src/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ export async function createPostgresContainer(network: StartedNetwork) {
2929
"push",
3030
"--force-reset",
3131
"--accept-data-loss",
32-
"--skip-generate",
3332
"--schema",
3433
`${databasePath}/prisma/schema.prisma`,
34+
"--url",
35+
container.getConnectionUri(),
3536
],
3637
{
3738
nodeOptions: {

0 commit comments

Comments
 (0)