use of liquibase.change.core.CreateProcedureChange in project quarkus by quarkusio.
the class LiquibaseMongodbProcessor method extractChangeFile.
private Optional<String> extractChangeFile(Change change, String changeSetFilePath) {
String path = null;
Boolean relative = null;
if (change instanceof LoadDataChange) {
LoadDataChange loadDataChange = (LoadDataChange) change;
path = loadDataChange.getFile();
relative = loadDataChange.isRelativeToChangelogFile();
} else if (change instanceof SQLFileChange) {
SQLFileChange sqlFileChange = (SQLFileChange) change;
path = sqlFileChange.getPath();
relative = sqlFileChange.isRelativeToChangelogFile();
} else if (change instanceof CreateProcedureChange) {
CreateProcedureChange createProcedureChange = (CreateProcedureChange) change;
path = createProcedureChange.getPath();
relative = createProcedureChange.isRelativeToChangelogFile();
} else if (change instanceof CreateViewChange) {
CreateViewChange createViewChange = (CreateViewChange) change;
path = createViewChange.getPath();
relative = createViewChange.getRelativeToChangelogFile();
}
// unrelated change or change does not reference a file (e.g. inline view)
if (path == null) {
return Optional.empty();
}
// absolute file path or changeSet has no file path
if (relative == null || !relative || changeSetFilePath == null) {
return Optional.of(path);
}
// notes: ClassLoaderResourceAccessor does not provide a suitable method and CLRA.getFinalPath() is not visible
return Optional.of(Paths.get(changeSetFilePath).resolveSibling(path).toString().replace('\\', '/'));
}
use of liquibase.change.core.CreateProcedureChange in project seed by euu-rocks.
the class DBObjectChangeLogBuilder method addCreateProcedureChange.
private void addCreateProcedureChange(DBObject dbObject) {
final CreateProcedureChange createProcedureChange = new CreateProcedureChange();
createProcedureChange.setEncoding(StreamUtils.CHARSET.name());
createProcedureChange.setProcedureName(dbObject.getInternalName());
createProcedureChange.setProcedureText(dbObject.getContent());
addChange(createProcedureChange);
}
use of liquibase.change.core.CreateProcedureChange in project quarkus by quarkusio.
the class LiquibaseProcessor method extractChangeFile.
private Optional<String> extractChangeFile(Change change, String changeSetFilePath) {
String path = null;
Boolean relative = null;
if (change instanceof LoadDataChange) {
LoadDataChange loadDataChange = (LoadDataChange) change;
path = loadDataChange.getFile();
relative = loadDataChange.isRelativeToChangelogFile();
} else if (change instanceof SQLFileChange) {
SQLFileChange sqlFileChange = (SQLFileChange) change;
path = sqlFileChange.getPath();
relative = sqlFileChange.isRelativeToChangelogFile();
} else if (change instanceof CreateProcedureChange) {
CreateProcedureChange createProcedureChange = (CreateProcedureChange) change;
path = createProcedureChange.getPath();
relative = createProcedureChange.isRelativeToChangelogFile();
} else if (change instanceof CreateViewChange) {
CreateViewChange createViewChange = (CreateViewChange) change;
path = createViewChange.getPath();
relative = createViewChange.getRelativeToChangelogFile();
}
// unrelated change or change does not reference a file (e.g. inline view)
if (path == null) {
return Optional.empty();
}
// absolute file path or changeSet has no file path
if (relative == null || !relative || changeSetFilePath == null) {
return Optional.of(path);
}
// notes: ClassLoaderResourceAccessor does not provide a suitable method and CLRA.getFinalPath() is not visible
return Optional.of(Paths.get(changeSetFilePath).resolveSibling(path).toString().replace('\\', '/'));
}
Aggregations