views:

22

answers:

1

Hello Everyone,

I can't figure out how to rollback custom Sql within a changeset. Any thoughts?

I'd like to do this:

<changeSet author="Charlie White" id="15" runAlways="false" runOnChange="false" failOnError="true">
<sql> 
INSERT INTO `XXXX` (`CONFIG_ID`,`NAME`,`VALUE`) VALUES YYYY;
</sql>
<rollback>
     DELETE FROM 'XXXX" WHERE 'YYYY";
</rollback>

Or possibly this:

<changeSet author="Charlie White" id="15" runAlways="false" runOnChange="false" failOnError="true">
<sql> 
INSERT INTO `XXXX` (`CONFIG_ID`,`NAME`,`VALUE`) VALUES YYYY;
</sql>
<rollback> <sql>
     DELETE FROM 'XXXX" WHERE 'YYYY";
</sql></rollback>

Thanks for the help.

A: 

It should be the first:

<changeSet author="Charlie White" id="15" runAlways="false" runOnChange="false" failOnError="true">
    <sql> 
    INSERT INTO `XXXX` (`CONFIG_ID`,`NAME`,`VALUE`) VALUES YYYY;
    </sql>
    <rollback>
     DELETE FROM 'XXXX" WHERE 'YYYY";
   </rollback>
</changeSet>
Nathan Voxland