Prisma1: Renaming a relation field is not recognized as a change

Created on 29 Sep 2017  路  5Comments  路  Source: prisma/prisma1

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:

  • The renamed relational field should be detected and the change should be applied.

Or:

  • The renamed relational field should be detected, and the user should be prompted to use @rename.
aredeploy

Most helpful comment

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

Thanks!

All 5 comments

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

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

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

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

Thanks!

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

schickling picture schickling  路  3Comments

marktani picture marktani  路  3Comments

Fi1osof picture Fi1osof  路  3Comments

tbrannam picture tbrannam  路  3Comments

hoodsy picture hoodsy  路  3Comments