Prisma1: Unable to deploy schema saying "MigrationValue method should only be called on scalar fields"

Created on 8 Apr 2019  Â·  5Comments  Â·  Source: prisma/prisma1

When I deploy the following schema, I'm getting this error:

Applying changes 1.6s
 â–¸    The Migration failed and has not been performed. This is very likely not a transient issue.
 â–¸    java.lang.RuntimeException: MigrationValue method should only be called on scalar fields.
 â–¸    at scala.sys.package$.error(package.scala:26)
 â–¸    at com.prisma.deploy.connector.MigrationValueGenerator.migrationValueForField(MigrationValueGenerator.scala:18)
 â–¸    at com.prisma.deploy.connector.MigrationValueGenerator.migrationValueForField$(MigrationValueGenerator.scala:9)
 â–¸    at com.prisma.deploy.connector.mysql.database.MySqlJdbcDeployDatabaseMutationBuilder.migrationValueForField(MysqlJdbcDeployDatabaseMutationBuilder.scala:20)
 â–¸    at com.prisma.deploy.connector.mysql.database.MySqlJdbcDeployDatabaseMutationBuilder.createColumn(MysqlJdbcDeployDatabaseMutationBuilder.scala:173)
 â–¸    at com.prisma.deploy.connector.jdbc.database.CreateColumnHelper$.withIndexIfNecessary(ColumnMutactionInterpreters.scala:156)
 â–¸    at com.prisma.deploy.connector.jdbc.database.CreateColumnInterpreter.execute(ColumnMutactionInterpreters.scala:14)
 â–¸    at com.prisma.deploy.connector.jdbc.database.JdbcDeployMutactionExecutor.execute(JdbcDeployMutactionExecutor.scala:19)
 â–¸    at com.prisma.deploy.migration.migrator.MigrationApplierImpl.executeClientMutaction(MigrationApplier.scala:119)
 â–¸    at com.prisma.deploy.migration.migrator.MigrationApplierImpl.$anonfun$applyStep$2(MigrationApplier.scala:106)
 â–¸    at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:303)
 â–¸    at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:37)
 â–¸    at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
 â–¸    at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55)
 â–¸    at akka.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)
 â–¸    at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:91)
 â–¸    at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40)
 â–¸    at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:44)
 â–¸    at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
 â–¸    at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
 â–¸    at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
 â–¸    at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)

Schema:

type Task {
  id: ID! @unique
  title: String!
  sectionId: ID!
  projectId: ID!
  # Serialized DateTime object
  deadline: String
  # In <hour>.<min>
  timeEstimate: Int
  note: String
  complete: Boolean!
  deleted: Boolean!
  archived: Boolean
  completedTime: DateTime
}

type Section {
  id: ID! @unique
  name: String!
}

type Project {
  id: ID! @unique
  name: String!
  sections: [Section]
}

To Reproduce

  1. Create a new service.
  2. Replace with above schema.
  3. Do a prisma deploy.

Versions (please complete the following information):

  • Connector: Demo database
  • prisma CLI: 1.29.1
  • OS: OS X High Sierra
bu2-confirmed areserver

All 5 comments

I was able to reproduce this.

image

To reproduce you might have to deploy the datamodel a couple of times. I also tried reproducing this locally but it was different. The API only had a node method like that.

fixed in 1.30.1

have this problem too

I am having the same problem too

I still have this issue in prisma/1.34.10 (darwin-x64) node-v10.16.3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MitkoTschimev picture MitkoTschimev  Â·  3Comments

dohomi picture dohomi  Â·  3Comments

jannone picture jannone  Â·  3Comments

sedubois picture sedubois  Â·  3Comments

Fi1osof picture Fi1osof  Â·  3Comments