Skip to content

[BUG] When using extend, the @@map is inherited as well #291

@dhritcu

Description

@dhritcu

In case we use Polymorphism with @@map, the generated prisma schema is invalid.

Given the following zmodel:

model Foo {
  //...
  @@map("foos")
}

model Bar extends Foo {
  @@map("bars")
}

It will generate the following prisma

model Foo {
  //...
  @@map("foos")
}

model Bar {
  @@map("foos")
  @@map("bars")
}

And will output the following validation error when generating migrations.

error: Attribute "@map" can only be defined once.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions