FIX: also include foreign keys without index in drop statement

This commit is contained in:
Jonas Pöhler
2023-08-16 11:59:50 +02:00
parent b0d8fa0286
commit 6ce5e865ca
@@ -130,7 +130,7 @@ public class ModelDiff {
existingTable.getCompoundKeys().forEach(it -> addAlterForeignKey(it.dropForeignKey(existingTable.getName())));
// Foreign keys through direct mapping (oneToMany)
existingTable.allColumns().stream()
.filter(it -> it.getForeignKeyIndex() != null)
.filter(it -> it.getForeignKeyIndex() != null || it.getForeignKeyName() != null)
.map(it -> {
AlterForeignKey fk = new AlterForeignKey();
fk.setName(it.getForeignKeyName());