Problem
If you have a table User, and a table that has a FK to that table, it will be introspected as User User? @relation(fields: [userId], references: [id])
This means that User will also be the key in the Client API
If you now want to rename this to authors for example, you can do so by changing it to authors User? @relation(fields: [userId], references: [id]) in the schema.
Problem: Next time you run prisma introspect this will be overwritten again, as the name authors is not persisted in the database.
Suggested solution
As a first prototype of Re-Introspection, we could keep the name authors after the next Prisma introspect by providing the old datamodel as additional input for introspection.
Problem
If you have a table User, and a table that has a FK to that table, it will be introspected as
User User? @relation(fields: [userId], references: [id])This means that User will also be the key in the Client API
If you now want to rename this to authors for example, you can do so by changing it to
authors User? @relation(fields: [userId], references: [id])in the schema.Problem: Next time you run prisma introspect this will be overwritten again, as the name
authorsis not persisted in the database.Suggested solution
As a first prototype of Re-Introspection, we could keep the name
authorsafter the next Prisma introspect by providing the old datamodel as additional input for introspection.