clj-liquibase icon indicating copy to clipboard operation
clj-liquibase copied to clipboard

Unable to use `sql-file` changes

Open mustangJaro opened this issue 4 years ago • 0 comments

When attempting to use the :sql-file change type, it never executes the SQL within the designated file. The documentation also needs to be updated since the required attribute is named path, not file-path. However, after the path value gets set onto the SQLFileChange class, the actual file is never read during the parse method. This creates a change that doesn't have an associated sql property populated and when liquibase generates the statements there are none to generate.

{:sql-file
  {:path             "sql/other-sql.sql"
   :split-statements false}}
public SqlStatement[] generateStatements(Database database) {
        List<SqlStatement> returnStatements = new ArrayList();
        String sql = StringUtils.trimToNull(this.getSql());
        if (sql == null) {
            return new SqlStatement[0];
        }
...
}

mustangJaro avatar May 06 '20 12:05 mustangJaro