prisma / prisma1

💾 Database Tools incl. ORM, Migrations and Admin UI (Postgres, MySQL & MongoDB) [deprecated]
https://v1.prisma.io/docs/
Apache License 2.0
16.54k stars 862 forks source link

Renaming a relation field is not recognized as a change #700

Closed marktani closed 6 years ago

marktani commented 7 years ago

What is the current behavior?

Changing only the name of a relational field in types.graphql is not picked up as a change by graphcool deploy.

Original types:

type User {
  id: ID! @isUnique
  name: String!
  posts: [Post!]! @relation(name: "UserOnPost")
}

type Post {
  id: ID! @isUnique
  title: String!
  user: User! @relation(name: "UserOnPost")
}

Intermediate types:

type User {
  id: ID! @isUnique
  name: String!
  posts: [Post!]! @relation(name: "UserOnPost")
}

type Post {
  id: ID! @isUnique
  title: String!
  author: User! @relation(name: "UserOnPost")
}

Running graphcool deploy tells me the project definition is identical.

What is the expected behavior?

Either:

Or:

marktani commented 7 years ago

Not sure how much this overlaps with the migration concept, #627.

welf commented 7 years ago

I think it is the same bug as here: https://github.com/graphcool/graphcool/issues/764

marktani commented 6 years ago

This issue has been moved to graphcool/graphcool-framework.

robbyemmert commented 6 years ago

Can you mention the issue this is being tracked on? I need to be able to rename relations without resetting my production database.

Thanks!

Kisepro commented 6 years ago

Any update about this ? I still face the problem with onDelete