In the manual it says that I can use this attribute to display a custom message when a precondition fails, but when I try to use it I get the error in the subject line.
Derek
In the manual it says that I can use this attribute to display a custom message when a precondition fails, but when I try to use it I get the error in the subject line.
Derek
What version of liquibase are you running, and what do you have for your schema definition in your root XML node? The onFailErrorMessage attribute is new in 2.0.
What is the error you are getting?
Nathan
Well I have included version 2.0 in my build path, but my system path was to 1.9.5. I am changing that to see what happens, if I get the same error I will update this post to include it. Because for some reason I can’t find the error in the log file I am just posting a screenshot of the tomcat output. I have changed everything to version 2.0-rc1 and I get the error output is:
I hope you can see the image because I can’t because of firewalls in place on the work computer
I think I may have figured it out. I am using the wrong schema, I just don’t know what I should enter for the correct one
So I am trying to set up my changelog file to use the 2.0 schema but I can’t seem to figure out the parameters. Here is my changelog:
<databaseChangeLog
xmlns=“http://www.liquibase.org/xml/ns/dbchangelog/1.9”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=“http://www.liquibase.org/xml/ns/dbchangelog/1.9
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd”>
<preConditions onFail="HALT" onFailMessage="Failed">
<and>
<dbms type="mysql"/>
<not>
<tableExists schemaName="reports" tableName="report_pairs"/>
</not>
</and>
</preConditions>
<changeSet id="1" author="derek" context="reporting">
<createTable tableName="report_pairs">
<column name="portletID" type="varchar(100)">
<constraints primaryKey="true"/>
</column>
<column name="reportPath" type="varchar(100)"/>
</createTable>
</changeSet>
I get an error:
Expecting namespace ‘<a href=‘http://www.liquibase.org/xml/ns/dbchangelog/1.9’,’ target=’_blank’>http://www.liquibase.org/xml/ns/dbchangelog/1.9’, but the target namespace of the schema document is ‘<a href=‘http://www.liquibase.org/xml/ns/dbchangelog’’ target=’_blank’>http://www.liquibase.org/xml/ns/dbchangelog’
Try this as the root element:
<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-2.0.xsd”>
Nathan
I was able to get my changelog file to run with the changes you mentioned above. I just upgraded to liquibase 2.0 and generated the changelog from an existing mssql database and when doing so it put 1.9 in the header info of the xml. How do i generate the changelog and have the right info in the xml header?