0

Our SQL script gets failed in Liquibase if the SQL script contains a "GO" statement. We deploy 30 to 50 SQL scripts on every release.

How does everyone check the preconditions of the sql file before submitting it for the Liquibase build? I am getting error like this below when sql script has "GO" statement in it.

20230-03-02 04:50:00 Liquibase INFO caused by: com.microsoft.sqlserver.jdbc.SQLServerException : Incorrect syntax near 'GO'

Multiple developers work on the team, so it's hard to manually check each and every file. Is there a way to do the precondition of liquibase before it triggers by Jenkins build

P.S : We have setup CI/CD for liquibase commit on lower environments.

John Scott
  • 119
  • 5
  • 1
    Does this answer your question? https://forum.liquibase.org/t/go-statement-been-treated-as-a-delimiter-in-single-changeset-file/4781/4 "I tried with endDelimiter:GO and it worked as expected when used fresh scripts. Looks during multiple tries this was earlier not working with endDelimiter:GO as well. So all good now. Thanks Ronak for your help." – siggemannen Mar 02 '23 at 17:51
  • @siggemannen i will try this option. Does endDelimiter:GO has to be setup in the liquibase property file or every changeset of the sql file? Where this configuration should go? Can you please advise? – John Scott Mar 02 '23 at 18:25
  • 1
    I gotta admit, i'm not an expert, but judging by that page, the enddelimiter goes into the actual "changeset file": –changeset XXXX:2 context:XXXX endDelimiter:GO runOnchange:true splitStatements=false – siggemannen Mar 02 '23 at 18:28

0 Answers0