opengb icon indicating copy to clipboard operation
opengb copied to clipboard

Cannot create module without defined DB model, Prisma throws error

Open jog1t opened this issue 8 months ago • 2 comments

@kacper said:

Can't create a module without a defined db model. Prisma throws an error.

Steps to reproduce:

  1. Init new OpenGB
  2. Adds some modules
  3. Run opengb create script my_module
  4. Run opengb create script my_module test
  5. Run opengb dev

You should see the following error:

error: Failed to run: prisma generate

  stdout: Prisma schema loaded from schema.prisma
  Prisma schema loaded from schema.prisma
  stderr: Error: 
You don't have any models defined in your schema.prisma, so nothing will be generated.
You can define a model like this:

model User {
  id    Int     @id @default(autoincrement())
  email String  @unique
  name  String?
}

More information in our documentation:
https://pris.ly/d/prisma-schema
  Error: 
  You don't have any models defined in your schema.prisma, so nothing will be generated.
  You can define a model like this:
  
  model User {
    id    Int     @id @default(autoincrement())
    email String  @unique
    name  String?
  }
  
  More information in our documentation:
  https://pris.ly/d/prisma-schema


Failed. Found 1 error.

jog1t avatar Jul 02 '24 21:07 jog1t