Hey Guys, A question: We have a production and sta...
# orm-help
f
Hey Guys, A question: We have a production and staging postgresql database which is currently using Typeorm as ORM. They are using the same schema, but indices, keys, … do not have the same IDs. We would like to migrate this System to Prisma. I started introspecting the staging database, using
prisma db pull
. This worked, however my schema now contains all sorts of mappings to existing keys, constraints, … E.g.:
@id(map: "PK_71a8d4792f7790deb531235496c")
@relation(fields: [seasonId], references: [id], onDelete: Cascade, onUpdate: NoAction, map: "FK_2725433beb670562c7ffe20b5a2")
These mapped IDs do not exist in the production database. My question is: Can I safely remove these mappings? What are they used / needed for? When starting “fresh”, prisma also does not generate these mappings..
I assume prisma needs these keys to identify the relations and can otherwise do it automatically because it infers the naming from the table and the key / index type, e.g.
Account_pkey
. I assume the best way would be renaming the keys and indices, but this seems like a lot of work.