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 void
addAddColumn(AddColumn addColumn)
Add the AlterColumn to the 'apply' changes.void
addAddHistoryTable(AddHistoryTable addHistoryTable)
Add the AddHistoryTable to apply changes.void
addAlterColumn(AlterColumn alterColumn)
Add the AlterColumn to the 'apply' changes.void
addAlterForeignKey(AlterForeignKey alterForeignKey)
Adds (or drops) a foreign key constraint to the 'apply' changes.void
addCreateIndex(CreateIndex createIndex)
Add the CreateIndex to the 'apply' changes.void
addDropColumn(DropColumn dropColumn)
Add the DropColumn to the 'drop' changes.void
addDropHistoryTable(DropHistoryTable dropHistoryTable)
Add the DropHistoryTable to the 'drop history' changes.void
addDropIndex(DropIndex dropIndex)
Add the DropIndex to the 'apply' changes.void
addTableComment(AddTableComment addTableComment)
Add a table comment to the 'apply' changes.void
addUniqueConstraint(AddUniqueConstraint addUniqueConstraint)
Adds (or drops) a unique constraint to the 'apply' changes.void
compareTo(ModelContainer newModel)
Compare to a 'newer' model and collect the differences.ChangeSet
getApplyChangeSet()
Return the 'apply' changeSet.Migration
getMigration()
Return the diff as a migration potentially containing an apply changeSet and a drop changeSet.boolean
isEmpty()
Return true if the 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 the 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.
-
-