In order to avoid this kind of exceptions you should never downgrade the version of the Mendix Modeler, but upgrade only. In your case, after deploying an app with 7.2, the same app had been accidentally deployed with the lower version of the Mendix Modeler. It introduced small inconsistency in the database, which can simply be solved by deleting "mendixsystem$unique_constraint" table and running the app with 7.2 or higher.
Is that all you see in the logfiles? I'm missing the root cause of the error.
I was wrong, the cosole shows:
com.mendix.m2ee.api.AdminException: Executing DDL commands for component MyFirstComponent failed.
at com.mendix.basis.component.internal.LocalComponentImpl.executeDDLCommands(LocalComponentImpl.scala:115)
Caused by: com.mendix.basis.connectionbus.ConnectionBusException: Error (SQL State: 42P07, Error Code: 0) on executing:
CREATE TABLE "mendixsystem$unique_constraint" (
"name" varchar(255) NOT NULL,
"table_id" varchar(36) NOT NULL,
"column_id" varchar(36) NOT NULL,
PRIMARY KEY("name","column_id"))
All changes are rolled back.
at com.mendix.connectionbus.modelsynchronization.DdlCommandExecutor.execute(DdlCommandExecutor.java:77)
Caused by: org.postgresql.util.PSQLException: ERROR: relation "mendixsystem$unique_constraint" already exists
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2412)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2125)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:297)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:301)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:287)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:264)
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:260)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:291)
at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:291)
at com.mendix.connectionbus.modelsynchronization.DdlCommandExecutor.executeDdlCommands(DdlCommandExecutor.java:134)
at com.mendix.connectionbus.modelsynchronization.DdlCommandExecutor.execute(DdlCommandExecutor.java:41)
at com.mendix.connectionbus.modelsynchronization.SynchronizationManager.synchronizeModel(SynchronizationManager.scala:151)
at com.mendix.connectionbus.modelsynchronization.SynchronizationManager.executeImpl(SynchronizationManager.scala:142)
at com.mendix.connectionbus.modelsynchronization.SynchronizationManager.execute(SynchronizationManager.scala:90)
at com.mendix.connectionbus.ConnectionBusImpl.executeDDLCommands(ConnectionBusImpl.java:402)
at com.mendix.basis.component.internal.LocalComponentImpl.executeDDLCommands(LocalComponentImpl.scala:112)
at com.mendix.basis.impl.MxRuntimeImpl.executeDDLCommands(MxRuntimeImpl.java:999)
at com.mendix.basis.action.admin.ExecuteDDLCommandsAction.call(ExecuteDDLCommandsAction.java:27)
at com.mendix.basis.action.admin.RuntimeAdminAction.execute(RuntimeAdminAction.java:18)
at com.mendix.m2ee.appcontainer.server.handler.HttpAdminHandler.handle(HttpAdminHandler.java:122)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:368)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:647)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Thread.java:745)
I have a similar issue:
CREATE TABLE "mendixsystem$unique_constraint" (
"name" VARCHAR_IGNORECASE(255) NOT NULL,
"table_id" VARCHAR_IGNORECASE(36) NOT NULL,
"column_id" VARCHAR_IGNORECASE(36) NOT NULL,
PRIMARY KEY("name","column_id"));
UPDATE "mendixsystem$version"
SET "preanalysismigrationversionnumber" = '3.0.0';