We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b77751 commit 989dd8aCopy full SHA for 989dd8a
tests/setup/global-setup.ts
@@ -9,7 +9,18 @@ export const BASE_DATABASE_PATH = path.join(
9
10
export async function setup() {
11
const databaseExists = await fsExtra.pathExists(BASE_DATABASE_PATH)
12
- if (databaseExists) return
+
13
+ if (databaseExists) {
14
+ const databaseLastModifiedAt = (await fsExtra.stat(BASE_DATABASE_PATH))
15
+ .mtime
16
+ const prismaSchemaLastModifiedAt = (
17
+ await fsExtra.stat('./prisma/schema.prisma')
18
+ ).mtime
19
20
+ if (prismaSchemaLastModifiedAt < databaseLastModifiedAt) {
21
+ return
22
+ }
23
24
25
await execaCommand(
26
'npx prisma migrate reset --force --skip-seed --skip-generate',
0 commit comments