Prisma 1 Forum

Prisma deploy error for mysql

I have got an error while deploying prisma. I have created a very simple table in relationship which couldn’t end in success. I tried multiple sources and multiple table definitions but I always got this error “Duplicate column name”.


type Contact @db(name: “contact”) {

id: Int! @id

info: String!

type: String!

customerid: Customer


type Customer @db(name: “customer”) {

id: Int! @id

contact: [Contact]

firstname: String!

lastname: String!



Contact (Type)

  • Created type Contact

  • Created field id of type Int!

  • Created field info of type String!

  • Created field type of type String!

  • Created field customerid of type Customer

Customer (Type)

  • Created type Customer

  • Created field id of type Int!

  • Created field contact of type [Contact!]!

  • Created field firstname of type String!

  • Created field lastname of type String!

ContactToCustomer (Relation)

  • Created an inline relation between Contact and Customer in the column customerid of table Contact

Applying changes 27.9s

▸ The Migration failed and has not been performed. This is very likely not a transient issue.

▸ java.sql.SQLSyntaxErrorException: (conn=924) Duplicate column name ‘customerid’

▸ at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.get(

▸ at org.mariadb.jdbc.internal.util.exceptions.ExceptionMapper.getException(

▸ at org.mariadb.jdbc.MariaDbStatement.executeExceptionEpilogue(

▸ at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(

▸ at org.mariadb.jdbc.MariaDbPreparedStatementClient.execute(

▸ at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(

▸ at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(

▸ at slick.jdbc.StatementInvoker.results(StatementInvoker.scala:38)

▸ at slick.jdbc.StatementInvoker.iteratorTo(StatementInvoker.scala:21)

▸ at slick.jdbc.Invoker.first(Invoker.scala:30)

▸ at slick.jdbc.Invoker.first$(Invoker.scala:29)

▸ at slick.jdbc.StatementInvoker.first(StatementInvoker.scala:15)

▸ at slick.jdbc.StreamingInvokerAction$

▸ at slick.jdbc.StreamingInvokerAction$

▸ at slick.basic.BasicBackend$DatabaseDef$$anon$2.liftedTree1$1(BasicBackend.scala:275)

▸ at slick.basic.BasicBackend$DatabaseDef$$anon$

▸ at java.util.concurrent.ThreadPoolExecutor.runWorker(

▸ at java.util.concurrent.ThreadPoolExecutor$

▸ at

▸ Caused by: java.sql.SQLException: Duplicate column name ‘customerid’

▸ Query is: ALTER TABLE

▸ ADD COLUMN customerid int NULL ,

▸ ADD FOREIGN KEY (customerid) REFERENCES testdb.customer(id) ON DELETE SET NULL;

▸ at org.mariadb.jdbc.internal.util.LogQueryTool.exceptionWithQuery(

▸ at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executeQuery(

▸ at org.mariadb.jdbc.MariaDbPreparedStatementClient.executeInternal(

▸ … 15 more