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

[Introspection] @@id refers to original field name instead of @map-ped one #1503

Closed
janpio opened this issue Feb 1, 2020 · 0 comments · Fixed by prisma/prisma-engines#451
Assignees
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. topic: introspection
Milestone

Comments

@janpio
Copy link
Member

janpio commented Feb 1, 2020

https://github.com/prisma/introspection-engine-output/blob/8e75a5342e388bc4b7eb8220976af011484422aa/mysql_127/Seznam_stderr.log#L5-L11

error: Unexpected token. Expected one of: 
  -->  schema.prisma:37
   | 
36 | 
37 |   @@id([client_id, Month/Year])
   |                         ^ Unexpected token.
   | 

https://github.com/prisma/introspection-engine-output/blob/8e75a5342e388bc4b7eb8220976af011484422aa/mysql_127/Seznam.log#L35-L42

model probehnuto_mimo_penezenku {
  Month_Year                      DateTime @map("Month/Year")
  probehla_inzerce_mimo_penezenku String?
  client_id                       client

  @@id([client_id, Month/Year])
  @@index([client_id], name: "probehnuto_mimo_penezenku_client_id")
}

Seems that during Introspection @map is applied to the field itself, but the new name is then not used in @@id.

(Problem probably also exists for @@unique and @@index)

@janpio janpio added bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. topic: introspection labels Feb 1, 2020
@janpio janpio changed the title [Introspection] @@id refers to original field name instead of @map-ped one [Introspection] @@id refers to original field name instead of @map-ped one Feb 1, 2020
@janpio janpio added this to the Preview 22 milestone Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/0-unknown Bug is new, does not have information for reproduction or reproduction could not be confirmed. kind/bug A reported bug. topic: introspection
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants