Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

Re : NullPointerException when generating changelog liquibase 3.0.3

$
0
0
Cool! For me, it was working with 3.0.2 with the same database
Here's the diff between 3.0.2 and 3.0.3 for that class

  1. git diff liquibase-parent-3.0.2 liquibase-parent-3.0.3 liquibase-core/src/main/java/liquibase/snapshot/jvm/ForeignKeySnapshotGenerator.java
  2. diff --git a/liquibase-core/src/main/java/liquibase/snapshot/jvm/ForeignKeySnapshotGenerator.java b/liquibase-core/src/main/java/liquibase/snapshot/jvm/ForeignKeySnapshotGenerator.
  3. index b8a87e9..8f9335f 100644
  4. --- a/liquibase-core/src/main/java/liquibase/snapshot/jvm/ForeignKeySnapshotGenerator.java
  5. +++ b/liquibase-core/src/main/java/liquibase/snapshot/jvm/ForeignKeySnapshotGenerator.java
  6. @@ -165,9 +165,11 @@ public class ForeignKeySnapshotGenerator extends JdbcSnapshotGenerator {
  7.                      continue;
  8.                  }

  9. -                Index exampleIndex = new Index().setTable(foreignKey.getForeignKeyTable());
  10. -                exampleIndex.getColumns().addAll(Arrays.asList(foreignKey.getForeignKeyColumns().split("\\s*,\\s*")));
  11. -                foreignKey.setBackingIndex(exampleIndex);
  12. +                if (database.createsIndexesForForeignKeys()) {
  13. +                    Index exampleIndex = new Index().setTable(foreignKey.getForeignKeyTable());
  14. +                    exampleIndex.getColumns().addAll(Arrays.asList(foreignKey.getForeignKeyColumns().split("\\s*,\\s*")));
  15. +                    foreignKey.setBackingIndex(exampleIndex);
  16. +                }

  17.                  return foreignKey;
  18.              }

Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>