org.openmrs.util.DatabaseUpdateException: There was an error while updating the database to the latest. file: liquibase-update-to-latest.xml. Error: Migration failed for change set liquibase-update-to-latest.xml::200902142213::ewolodzko: Reason: liquibase.exception.DatabaseException: Error executing SQL UPDATE person_attribute_type as A JOIN person_attribute_type as B ON A.name = B.name SET A.sort_weight = (select count(*) from (select * from person_attribute_type) pat where pat.name < A.name) WHERE A.sort_weight is null: You can't specify target table 'A' for update in FROM clause: Caused By: Error executing SQL UPDATE person_attribute_type as A JOIN person_attribute_type as B ON A.name = B.name SET A.sort_weight = (select count(*) from (select * from person_attribute_type) pat where pat.name < A.name) WHERE A.sort_weight is null: You can't specify target table 'A' for update in FROM clause: Caused By: You can't specify target table 'A' for update in FROM clause at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:152) at org.openmrs.web.filter.initialization.InitializationFilter$InitializationCompletion$1.run(InitializationFilter.java:1643) at java.lang.Thread.run(Thread.java:745) Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set liquibase-update-to-latest.xml::200902142213::ewolodzko: Reason: liquibase.exception.DatabaseException: Error executing SQL UPDATE person_attribute_type as A JOIN person_attribute_type as B ON A.name = B.name SET A.sort_weight = (select count(*) from (select * from person_attribute_type) pat where pat.name < A.name) WHERE A.sort_weight is null: You can't specify target table 'A' for update in FROM clause: Caused By: Error executing SQL UPDATE person_attribute_type as A JOIN person_attribute_type as B ON A.name = B.name SET A.sort_weight = (select count(*) from (select * from person_attribute_type) pat where pat.name < A.name) WHERE A.sort_weight is null: You can't specify target table 'A' for update in FROM clause: Caused By: You can't specify target table 'A' for update in FROM clause at liquibase.changelog.ChangeSet.execute(ChangeSet.java:347) at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:27) at org.openmrs.util.DatabaseUpdater$1OpenmrsUpdateVisitor.visit(DatabaseUpdater.java:189) at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:58) at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:218) at org.openmrs.util.DatabaseUpdater.executeChangelog(DatabaseUpdater.java:148) ... 2 more Caused by: liquibase.exception.DatabaseException: Error executing SQL UPDATE person_attribute_type as A JOIN person_attribute_type as B ON A.name = B.name SET A.sort_weight = (select count(*) from (select * from person_attribute_type) pat where pat.name < A.name) WHERE A.sort_weight is null: You can't specify target table 'A' for update in FROM clause at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:62) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:104) at liquibase.database.AbstractDatabase.execute(AbstractDatabase.java:1091) at liquibase.database.AbstractDatabase.executeStatements(AbstractDatabase.java:1075) at liquibase.changelog.ChangeSet.execute(ChangeSet.java:317) ... 7 more Caused by: java.sql.SQLException: You can't specify target table 'A' for update in FROM clause at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1086) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4237) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4169) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2617) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2819) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2768) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:949) at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:795) at liquibase.executor.jvm.JdbcExecutor$1ExecuteStatementCallback.doInStatement(JdbcExecutor.java:92) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55) ... 11 more