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

prismaSchemaExists logic is wrong #76

Open
husayt opened this issue Dec 30, 2024 · 2 comments · May be fixed by #80
Open

prismaSchemaExists logic is wrong #76

husayt opened this issue Dec 30, 2024 · 2 comments · May be fixed by #80

Comments

@husayt
Copy link

husayt commented Dec 30, 2024

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

@husayt
Copy link
Author

husayt commented Dec 30, 2024

same for here:

        resolveProject(LAYER_PATH, "prisma", "migrations"),

prisma files not necesarily need to be inside prisma folder

@ankur-arch
Copy link
Contributor

ankur-arch commented Dec 31, 2024

Thanks @husayt for reporting this 🙏 !

@jharrell jharrell added the nuxt-module label Jan 3, 2025 — with Linear
@jharrell jharrell removed the nuxt label Jan 3, 2025
Dobefu added a commit to Dobefu/nuxt-prisma that referenced this issue Jan 6, 2025
Dobefu added a commit to Dobefu/nuxt-prisma that referenced this issue Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants