<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog
  xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd">

  <changeSet author="sflaniga@redhat.com" id="check-innodb" runAlways="true"
    dbms="mysql">
    <preConditions onFail="HALT">
      <sqlCheck expectedResult="0">
        SELECT count(*) FROM information_schema.tables
        WHERE TABLE_SCHEMA = SCHEMA() AND engine != 'InnoDB'
      </sqlCheck>
    </preConditions>
    <comment>Check that all tables are InnoDB</comment>
  </changeSet>

</databaseChangeLog>

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog
  xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd">

  <!-- This precondition changeset might fail if:
       (a) CreateTableGeneratorInnoDB stops working (eg Liquibase upgrade), or
       (b) someone creates a non-InnoDB table in Zanata's schema.
  -->
  <changeSet author="sflaniga@redhat.com" id="check-innodb" runAlways="true"
    dbms="mysql">
    <preConditions onFail="HALT" onFailMessage="All tables in the schema must be InnoDB: ALTER TABLE table_name ENGINE = INNODB">
      <sqlCheck expectedResult="0">
        SELECT count(*) FROM information_schema.tables
        WHERE TABLE_SCHEMA = SCHEMA() AND engine != 'InnoDB'
      </sqlCheck>
    </preConditions>
    <comment>Check that all tables are InnoDB</comment>
  </changeSet>

</databaseChangeLog>

Add meaningful error message when precondition fails
Add meaningful error message when precondition fails
