prisma-schema-transformer icon indicating copy to clipboard operation
prisma-schema-transformer copied to clipboard

@@index 's are removed

Open jrmyio opened this issue 3 years ago • 1 comments

It seems like the transformer removes @@indexes.

model ads_clicks {
  id       Int      @default(autoincrement()) @id
  ad_id    Int?
  datetime DateTime
  @@index([ad_id], name: "IDX_BA7A601F4F34D596")
}

Transform to

model AdsClick {
  id       Int      @id @default(autoincrement())
  adId     Int?     @map("ad_id")
  datetime DateTime
  @@map("ads_clicks")
}

jrmyio avatar Aug 25 '20 08:08 jrmyio

@ConneXNL

Properly @@index is not handled by the deserializer. Let me know if you are willing to help adding support to preserve @@index during transformation. I can help you to get started.

michaellzc avatar Sep 03 '20 03:09 michaellzc