#2283 - ddl-generator - Add DbMigration.addPlatform(Platform) with default sub-directory based on Platform

This commit is contained in:
rbygrave committed 2021-08-02 20:15:51 +12:00
1 parent d601a88d82
commit 928b90122f
5 files changed
+52 -55

No files matched your search

@@ -34,16 +34,14 @@ public class MigrationModel {
* Read all the migrations returning the model with all
* the migrations applied in version order.
*
* @param dbinitMigration If true we don't apply model changes, migration is from scratch.
* @param initMigration If true we don't apply model changes, migration is from scratch.
*/
public ModelContainer read(boolean dbinitMigration) {
readMigrations(dbinitMigration);
public ModelContainer read(boolean initMigration) {
readMigrations(initMigration);
return model;
}
private void readMigrations(boolean dbinitMigration) {
private void readMigrations(boolean initMigration) {
// find all the migration xml files
File[] xmlFiles = modelDirectory.listFiles(pathname -> pathname.getName().toLowerCase().endsWith(modelSuffix));
if (xmlFiles == null || xmlFiles.length == 0) {
@@ -57,7 +55,7 @@ public class MigrationModel {
// sort into version order before applying
Collections.sort(resources);
if (!dbinitMigration) {
if (!initMigration) {
for (MigrationResource migrationResource : resources) {
logger.debug("read {}", migrationResource);
model.apply(migrationResource.read(), migrationResource.getVersion());