use of liquibase.change.DatabaseChangeProperty in project liquibase by liquibase.
the class SQLFileChange method getSql.
@Override
@DatabaseChangeProperty(isChangeProperty = false)
public String getSql() {
String sql = super.getSql();
if (sql == null) {
InputStream sqlStream;
try {
sqlStream = openSqlStream();
if (sqlStream == null) {
return null;
}
String content = StreamUtil.readStreamAsString(sqlStream, getEncoding());
if (getChangeSet() != null) {
ChangeLogParameters parameters = getChangeSet().getChangeLogParameters();
if (parameters != null) {
content = parameters.expandExpressions(content, getChangeSet().getChangeLog());
}
}
return content;
} catch (IOException e) {
throw new UnexpectedLiquibaseException(e);
}
} else {
return sql;
}
}
Aggregations