Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Self-relation column order? #5161

Closed
terion-name opened this issue Jun 29, 2021 · 1 comment
Closed

Self-relation column order? #5161

terion-name opened this issue Jun 29, 2021 · 1 comment
Labels
status/stale Marked as state by the GitHub stalebot

Comments

@terion-name
Copy link

I am currently migratiing from prisma1 to prisma2 and there is question in scope of data migrating.

If we have a self-relation (a parent-children tree for example or a many-to-many graph), I can't determine what side what in relation table will be? I can obviously check it for certain cases by data, but I need a rule to make a migration script for multiple projects.

E.g.

type Unit {
    id: ID! @id
    managedBy: Unit @relation(name: "Manage" link: TABLE)
    manages: [Unit!]! @relation(name: "Manage")
}

In this case managedBy is in A column and manages in B, but why? Because of parent-child relation? If yes then what it would by in M2M? Or because of field names and alphabetical ordering?

@terion-name terion-name changed the title Self-relation column order Self-relation column order? Jun 29, 2021
@stale
Copy link

stale bot commented Sep 22, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status/stale Marked as state by the GitHub stalebot label Sep 22, 2021
@stale stale bot closed this as completed Jan 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status/stale Marked as state by the GitHub stalebot
Projects
None yet
Development

No branches or pull requests

1 participant