captaindaylight
07/31/2018, 2:47 PMERROR: There is a relation ambiguity during the migration. Please first name the old relation on your schema. The ambiguity is on a relation between Trip and User. Please name relations or change the schema in steps.
marcus
07/31/2018, 3:15 PM@relation
to name the old relation. (So no need to adapt your example as you did so)
3. Run prisma deploy
4. Bring back the new relation by uncommenting it. Run prisma deploy
marcus
07/31/2018, 3:17 PMcaptaindaylight
07/31/2018, 9:44 PMYou are creating a required relation, but there are already nodes that would violate that constraint.
Anyway I couldn’t figure out how to solve it so I created a new demo server and everything deployed correctly.marcus
08/01/2018, 7:24 AMowner: User!
. So a Trip
always needs to have a User
in your schema. When you executed deploy, there were already nodes for the type Trip
. If the deploy would be executed there would be Trips that do not have a user which would violate your schema.marcus
08/01/2018, 7:27 AMprisma reset
This will wipe the database in your service. Therefore there can’t be invalid data.
2. First deploy that field as optional owner: User
. Then execute a mutation updateManyTrips
to connect existing trips to a dummy user. Afterwards you can make the field required and the server won’t complain.