Class ModelDiff
java.lang.Object
io.ebeaninternal.dbmigration.model.ModelDiff
Used to prepare a diff in terms of changes required to migrate from
the base model to the newer model.
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct with a base model.ModelDiff(ModelContainer baseModel)Construct with a base model. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAddColumn(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.Return the 'apply' changeSet.Return the diff as a migration potentially containing an apply changeSet and a drop changeSet.booleanisEmpty()Return true if the apply and drop changes are both empty.
-
Constructor Details
-
ModelDiff
Construct with a base model. -
ModelDiff
public ModelDiff()Construct with a base model.
-
-
Method Details
-
isEmpty
Return true if the apply and drop changes are both empty. This means there are no migration changes. -
getMigration
Return the diff as a migration potentially containing an apply changeSet and a drop changeSet. -
getApplyChangeSet
Return the 'apply' changeSet. -
compareTo
Compare to a 'newer' model and collect the differences. -
addAlterColumn
Add the AlterColumn to the 'apply' changes. -
addAddColumn
Add the AlterColumn to the 'apply' changes. -
addDropColumn
Add the DropColumn to the 'drop' changes. -
addAddHistoryTable
Add the AddHistoryTable to apply changes. -
addDropHistoryTable
Add the DropHistoryTable to the 'drop history' changes. -
addDropIndex
Add the DropIndex to the 'apply' changes. -
addCreateIndex
Add the CreateIndex to the 'apply' changes. -
addTableComment
Add a table comment to the 'apply' changes. -
addUniqueConstraint
Adds (or drops) a unique constraint to the 'apply' changes. -
addAlterForeignKey
Adds (or drops) a foreign key constraint to the 'apply' changes.
-