Class ModelDiff
- java.lang.Object
-
- io.ebeaninternal.dbmigration.model.ModelDiff
-
-
Constructor Summary
Constructors Constructor Description ModelDiff()Construct with a base model.ModelDiff(ModelContainer baseModel)Construct with a base model.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAddColumn(AddColumn addColumn)Add the AlterColumn to the 'apply' changes.voidaddAddHistoryTable(AddHistoryTable addHistoryTable)Add the AddHistoryTable to apply changes.voidaddAlterColumn(AlterColumn alterColumn)Add the AlterColumn to the 'apply' changes.voidaddAlterForeignKey(AlterForeignKey alterForeignKey)Adds (or drops) a foreign key constraint to the 'apply' changes.voidaddCreateIndex(CreateIndex createIndex)Add the CreateIndex to the 'apply' changes.voidaddDropColumn(DropColumn dropColumn)Add the DropColumn to the 'drop' changes.voidaddDropHistoryTable(DropHistoryTable dropHistoryTable)Add the DropHistoryTable to the 'drop history' changes.voidaddDropIndex(DropIndex dropIndex)Add the DropIndex to the 'apply' changes.voidaddTableComment(AddTableComment addTableComment)Add a table comment to the 'apply' changes.voidaddUniqueConstraint(AddUniqueConstraint addUniqueConstraint)Adds (or drops) a unique constraint to the 'apply' changes.voidcompareTo(ModelContainer newModel)Compare to a 'newer' model and collect the differences.ChangeSetgetApplyChangeSet()Return the 'apply' changeSet.MigrationgetMigration()Return the diff as a migration potentially containing an apply changeSet and a drop changeSet.booleanisEmpty()Return true if apply and drop changes are both empty.
-
-
-
Constructor Detail
-
ModelDiff
public ModelDiff(ModelContainer baseModel)
Construct with a base model.
-
ModelDiff
public ModelDiff()
Construct with a base model.
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Return true if apply and drop changes are both empty. This means there are no migration changes.
-
getMigration
public Migration getMigration()
Return the diff as a migration potentially containing an apply changeSet and a drop changeSet.
-
getApplyChangeSet
public ChangeSet getApplyChangeSet()
Return the 'apply' changeSet.
-
compareTo
public void compareTo(ModelContainer newModel)
Compare to a 'newer' model and collect the differences.
-
addAlterColumn
public void addAlterColumn(AlterColumn alterColumn)
Add the AlterColumn to the 'apply' changes.
-
addAddColumn
public void addAddColumn(AddColumn addColumn)
Add the AlterColumn to the 'apply' changes.
-
addDropColumn
public void addDropColumn(DropColumn dropColumn)
Add the DropColumn to the 'drop' changes.
-
addAddHistoryTable
public void addAddHistoryTable(AddHistoryTable addHistoryTable)
Add the AddHistoryTable to apply changes.
-
addDropHistoryTable
public void addDropHistoryTable(DropHistoryTable dropHistoryTable)
Add the DropHistoryTable to the 'drop history' changes.
-
addDropIndex
public void addDropIndex(DropIndex dropIndex)
Add the DropIndex to the 'apply' changes.
-
addCreateIndex
public void addCreateIndex(CreateIndex createIndex)
Add the CreateIndex to the 'apply' changes.
-
addTableComment
public void addTableComment(AddTableComment addTableComment)
Add a table comment to the 'apply' changes.
-
addUniqueConstraint
public void addUniqueConstraint(AddUniqueConstraint addUniqueConstraint)
Adds (or drops) a unique constraint to the 'apply' changes.
-
addAlterForeignKey
public void addAlterForeignKey(AlterForeignKey alterForeignKey)
Adds (or drops) a foreign key constraint to the 'apply' changes.
-
-