Hey there! when i create a datamodel with relation...
# orm-help
p
Hey there! when i create a datamodel with relations (for ex: Author has id, name and Article has id, title, content, author_id: Author), they are not created as foreign keys in the underlying MySQL database. It creates a new mapping table. Is this a known issue/workflow or am i missing something?
j
You will get the data from the relational table when you query it.
p
I know the GraphQL Query still works and the data can be fetched. But the underlying MySQL foreign keys are not maintained the way it ideally should be. Thats what i was concerned about
j
Its a correct way @praveenweb
n
@praveenweb this is the current approach if your connector is doing DB migrations. for connectors that don't do migrations, and that connect to existing DBs, other ways to represent relations are supported. you can read more about this here: https://www.prisma.io/docs/reference/service-configuration/introspection-aeb6diethe