Hi! I have stumbled upon an interesting issue. First of all, I am well aware that this is an issue on the developer’s side, that they should simply give us one sql command per .sql file, but this is what we have to live with, so no chance to change this.
Our developer is giving us an .sql files which contain often multiple commands, for example
And I have noticed, that if I will use the failOnError:false parameter, and there is a database issue, for example, that the table already exists, when it tries to create it, that it will not execute remaining commands in the .sql file, and it will move to another .sql file.
And my question is, is there any way how to tell Liquibase, that in case of error, it should move to the next command in the .sql file, after the “/” separator?
Using this attribute in that form is what you need, yes, but also something else: if not already, converting the .sql files into liquibase formatted sql (files).
Then you need to make each individual DDL statement a separate changeset (--changeset author:id attribute1:value1…) and each of these can/should have the failOnError attribute set accordingly (to false).
While I am not sure this is a good practice (to silently continue in case of an error), I know each project/case has its “specific” flavors. this setup should ensure that if a particular statement fails, execution (still) continues.
Definitely at changelog (file) level (so each changelog can have similar id-ing… i.e id:1, id:2 or id1, id2 or whatever project agrees). There isn’t a requirement that ids need to be unique across entire files/changelogs base. This translates into Option B as you mentioned in the above example.
As long as you have the combination id, author, filename (logicalFilePath) unique at changelog (file) level, you’re set.