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

Specific migrations are not handled correctly #1640

Closed
marktani opened this issue Jan 16, 2018 · 1 comment
Closed

Specific migrations are not handled correctly #1640

marktani opened this issue Jan 16, 2018 · 1 comment

Comments

@marktani
Copy link
Contributor

Two different cases. Version: 1.0.0-beta.4.1.4

First

First, deploy

type User {
  instagram: String
}

Then deploy

type Instagram {
  name: String!
}

type User {
  instagram: Instagram!
}

Deploying is stuck forever:

Changes:

  Instagram (Type)
  + Created type `Instagram`
  + Created field `name` of type `String!`
  + Created field `id` of type `GraphQLID!`
  + Created field `updatedAt` of type `DateTime!`
  + Created field `createdAt` of type `DateTime!`

  User (Type)
  ~ Updated field `instagram`. It became required.

  InstagramToUser (Relation)
  + Created relation between Instagram and User

Applying changes (5/7) ⣾

Second

First, deploy

type User {
  instagram: String
}

Then, deploy

type InstagramMedia {
  type: String!
  mediaUrl: String!
  thumbnailUrl: String
  permalink: String!
  likeCount: Int!
  timestamp: DateTime!
}

type User {
  instagram: Instagram!
}

type Instagram {
  name: String!
}

Error result:

Changes:

  InstagramMedia (Type)
  + Created type `InstagramMedia`
  + Created field `type` of type `String!`
  + Created field `mediaUrl` of type `String!`
  + Created field `thumbnailUrl` of type `String`
  + Created field `permalink` of type `String!`
  + Created field `likeCount` of type `Int!`
  + Created field `timestamp` of type `DateTime!`
  + Created field `id` of type `GraphQLID!`
  + Created field `updatedAt` of type `DateTime!`
  + Created field `createdAt` of type `DateTime!`

  Instagram (Type)
  + Created type `Instagram`
  + Created field `name` of type `String!`
  + Created field `id` of type `GraphQLID!`
  + Created field `updatedAt` of type `DateTime!`
  + Created field `createdAt` of type `DateTime!`

  User (Type)
  ~ Updated field `instagram`. It became required.

  InstagramToUser (Relation)
  + Created relation between Instagram and User

Applying changes !
 ▸    java.lang.RuntimeException: Relation is not a scalar type. Are you tryingto create a db column for a relation?
 ▸    at scala.sys.package$.error(package.scala:27)
 ▸    atcool.graph.deploy.database.DatabaseMutationBuilder$.sqlTypeForScalarTypeIdentifier(DatabaseMutationBuilder.scala:182)
 ▸    atcool.graph.deploy.database.DatabaseMutationBuilder$.updateColumn(DatabaseMutationBuilder.scala:129)
 ▸    atcool.graph.deploy.migration.mutactions.UpdateColumn.updateFromBeforeStateToAfterState(UpdateColumn.scala:56)
 ▸    atcool.graph.deploy.migration.mutactions.UpdateColumn.execute(UpdateColumn.scala:17)
 ▸    atcool.graph.deploy.migration.migrator.MigrationApplierImpl.executeClientMutaction(MigrationApplier.scala:108)
 ▸    atcool.graph.deploy.migration.migrator.MigrationApplierImpl.applyStep(MigrationApplier.scala:94)
 ▸    atcool.graph.deploy.migration.migrator.MigrationApplierImpl.recurseForward(MigrationApplier.scala:45)
 ▸    atcool.graph.deploy.migration.migrator.MigrationApplierImpl.$anonfun$recurseForward$3(MigrationApplier.scala:48)
 ▸    at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:302)
 ▸    atscala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37)
 ▸    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
 ▸    atakka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
 ▸    atakka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:91)
 ▸    at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
 ▸    at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:81)
 ▸    atakka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91)
 ▸    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
 ▸    atakka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:43)
 ▸    at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
 ▸    atakka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
 ▸    at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
 ▸    atakka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
 ▸

Get in touch if you need help: https://www.graph.cool/forum
To get more detailed output, run $ set -x DEBUG "*"
@stale
Copy link

stale bot commented Jun 27, 2018

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants