Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

Liquibase Update/Rollback for Function does not work

$
0
0
Trying to update an existing SQL function, the SQL code is correct (have run it directly on the database) but cannot get Liquibase to run it successfully, or roll it back :(

Liquibase says 'Migration Successful' on update but nothing is changed in the DB, and 'Migration Failed: Unknown Reason' on rollback.
<?xml version="1.0" encoding="UTF-8"?>

<databaseChangeLog
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.7"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.7 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.7.xsd">
    
  <changeSet id="00" author="johnsmith">
    <sql splitStatements="false">
DROP FUNCTION dummy(text, text, text);
CREATE OR REPLACE FUNCTION dummy(var1 text, var2 text, var3 text, newvar1 text)
  RETURNS void AS
$BODY$

/*
does new stuff here
*/
    RETURN;

END;
$BODY$
  LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION dummy(text, text, text, text) OWNER TO bob;

	</sql>
    <rollback>
DROP FUNCTION dummy(text, text, text, text);
CREATE OR REPLACE FUNCTION dummy(var1 text, var2 text, var3 text)
  RETURNS void AS
$BODY$
/*
do old stuff here
*/
    RETURN;

END;
$BODY$
  LANGUAGE 'plpgsql' VOLATILE;
ALTER FUNCTION dummy(text, text, text) OWNER TO bob;
    </rollback>
  </changeSet>
</databaseChangeLog>

Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>