Skip to content

prismaSchemaExists logic is wrong #76

@husayt

Description

@husayt

the following doesn't include the case of schema.prisma being in project root folder. Prisma itself sees this file, but module complains if I press it inside root of the project

resolveProject(LAYER_PATH, "prisma", "schema.prisma"),

Here is the correct version;

 const prismaSchemaExists = checkIfPrismaSchemaExists([
      resolveProject(LAYER_PATH, "prisma", "schema.prisma"),
     resolveProject(LAYER_PATH,  "schema.prisma"),  
      resolveProject(LAYER_PATH, "prisma", "schema"),
    ]);

Also, shouldn't it be also check prismaSchemaPath?
Also should check package.json as it also might override schema location

 "prisma": {
    "schema": "./schema.prisma"
  }

Module should follow Prisma's standard behavior

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions