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

Liquibase Rollback Error for Multi-Line Rollback Script

$
0
0
Hi,
I'm getting an error when I attempt to roll back this sample script (below).  Is this the correct way to format multi-line rollbacks?  We've played with splitStatements, but no luck.  Next we'll try to use XML, but would love to stick with this format.

Thanks in advance for any help!
Rich

Here is the error:
[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.2.0:rollback (default-cli) on project database: Error setting up or running Liquibase: liquibase.exception.RollbackFailedException: Error executing custom SQL [CREATE OR REPLACE FUNCTION a_number() RETURNS integer AS $$
[ERROR] BEGIN
[ERROR] RETURN 1]: Error executing SQL CREATE OR REPLACE FUNCTION a_number() RETURNS integer AS $$
[ERROR] BEGIN
[ERROR] RETURN 1: ERROR: unterminated dollar-quoted string at or near "$$
[ERROR] BEGIN
[ERROR] RETURN 1"
[ERROR] Position: 58
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException


-- Start Liquibase Script
--liquibase formatted sql
--changeset rhanbidge :foo splitStatements:false

CREATE OR REPLACE FUNCTION a_number() RETURNS integer AS $$
BEGIN
    RETURN 2;
END
$$ LANGUAGE plpgsql;

--rollback CREATE OR REPLACE FUNCTION a_number() RETURNS integer AS $$
--rollback BEGIN
--rollback     RETURN 1;
--rollback END
--rollback $$ LANGUAGE plpgsql;



Viewing all articles
Browse latest Browse all 2993

Trending Articles



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