mysql - liquibase rollback always rollsback to a clean empty database -
i've been trying learn liquibase , , trying perform simple roll back. when executes rolls fresh database though i'm trying rollback specific tag. command line below...
java -jar liquibase.jar --changelogfile=/media/galactus/documents/changelogs/ch_q_10.xml rollback "1.0.0-release"
the change log i'm using pasted below well. expect end going version 1.0.0 database rolls entire thing back. i've confirmed version tag in changelog i"m not sure i'm missing.
<databasechangelog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xsi:schemalocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd"> <changeset id="1" author="root"> <preconditions onfail="mark_ran"> <tableexists tablename="student" schemaname="public"/> </preconditions> <createtable tablename="student"> <column name="id" type="int"> <constraints primarykey="true" nullable="false"/> </column> <column name="name" type="varchar(50)"> <constraints nullable="false"/> </column> <column name="enrolled" type="boolean" defaultvalueboolean="false"/> </createtable> </changeset> <changeset id="2" author="root"> <preconditions onfail="mark_ran"> <columnexists tablename="student" columnname="grade" schemaname="public"/> </preconditions> <addcolumn tablename="student"> <column name="grade" type="decimal(4,2)" /> </addcolumn> </changeset> <changeset id="3" author="root"> <preconditions onfail="mark_ran"> <columnexists tablename="student" columnname="enrolled" schemaname="public"/> </preconditions> <dropcolumn columnname="enrolled" tablename="student"/> <rollback>alter table student add column enrolled boolean;</rollback> </changeset> <changeset id="4" author="root" > <tagdatabase tag="1.0.0-release"/> </changeset> <changeset id="5" author="root"> <createtable tablename="instructor"> <column name="id" type="int"> <constraints primarykey="true" nullable="false"/> </column> <column name="name" type="varchar(50)"> <constraints nullable="false"/> </column> <column name="start_date" type="varchar(50)" /> </createtable> </changeset> <changeset id="6" author="root" > <tagdatabase tag="1.1.0-release"/> </changeset> </databasechangelog>
below shot of change log showing version tag, never rollsback tag, continues rollback everything.
any thoughts or ideas appreciated, i've read seems should rather straight forward , i'm bit baffled.
Comments
Post a Comment