zenstack icon indicating copy to clipboard operation
zenstack copied to clipboard

[BUG] `@@ignore` does not override other checks (like checking for a unique criteria)

Open lsmith77 opened this issue 5 months ago • 0 comments

Description and expected behavior In prisma using @@ignore on a model seems to disable all model validation, which is not the case for zModel.

The following model works fine in Prisma but fails in zModel

model beschaffungen_anbieter {
    Anbieter               String? @db.VarChar(255)
    Anbieter_id            Int?
    AnzZuschlaege          Int?
    SummeZuschlaege        Float?
    AnzFreihaender         Int?
    AnteilAnzFreihaender   Float?
    SummeFreihaender       Int?
    AnteilSummeFreihaender Float?
    waehrung               String? @db.VarChar(255)
    AnzahlKeinPreis        Int?
    AnteilMitPreis         Float?

    @@ignore
}

Here is error message from zModel from the CLI but it is also shown in the VSCode Plugin

schema.zmodel:21:1 - Model must have at least one unique criteria. Either mark a single field with `@id`, `@unique` or add a multi field criterion with `@@id([])` or `@@unique([])` to the model.

Environment (please complete the following information):

  • ZenStack version: 2.16.0
  • Prisma version: 6.10
  • Database type: MariaDB

Additional context Add any other context about the problem here.

lsmith77 avatar Jul 03 '25 08:07 lsmith77