I am hoping that someone may be able to help me. I...
# prisma-migrate
n
I am hoping that someone may be able to help me. I am trying to make the move from using mongoose to prisma (mongodb), where i hav an existing dataset. I know that there are some changes that need to be made to the database. I have already found that the collection names names need to be changed (from plural to single), but are there other changes that are needed? Currently I cannot get any of my relationships to work (this could easily be an issue in another part of the code, however i wanted to check it was not a db issue). Thanks!
j
Hey, the singular/plural thing might not be neecssary - Prisma can model any collection/Table names. Only if you want to have a different Prisma Client API, you can adapt that - but you can also use @map to ... map collection names to other model names (eg singular->plural): https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#map-1
What kind of relationships are you trying to get to work? Embedded documents (does not work yet) or a foreign key style relationship (should work)?
n
Thanks for the response. The relationships are not embedded, they are by reference. It sounds like it is an issue somewhere else in my code and not the database. Thank you!
j
We don't have great tooling to support you in that yet unfortunately, but will hopefully get there (E.g. Introspection, that just creates a schema based on your structure and data).
If you are having trouble, I would suggest you extract a simple slice of your data with a clear relationship, and try to model just that in a new simple app. Pulling things out of the bigger context of your whole app usually makes it easier to figure out what is happening and might help you understand what is going on easily.
👍 1