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

MySQL multi-value index removes the primary key on introspection #18471

Closed
pimeys opened this issue Mar 24, 2023 · 0 comments · Fixed by prisma/prisma-engines#3813
Closed

MySQL multi-value index removes the primary key on introspection #18471

pimeys opened this issue Mar 24, 2023 · 0 comments · Fixed by prisma/prisma-engines#3813
Labels
Milestone

Comments

@pimeys
Copy link
Contributor

pimeys commented Mar 24, 2023

With the given DDL:

CREATE TABLE customers
(
    id       INT AUTO_INCREMENT PRIMARY KEY,
    custinfo JSON,
    INDEX zips ((CAST(custinfo -> '$.zipcode' AS UNSIGNED ARRAY)))
);

The introspection will not render the =@id= attribute to the =id= field:

/// The underlying table does not contain a valid unique identifier and can therefore currently not be handled by the Prisma Client.
model customers {
  id       Int       @default(autoincrement())
  custinfo Json?

  @@ignore
}

If we do not have the index defined, we correctly render the id as id Int @id @default(autoincrement()).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants