mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#374 - Move db constraint max length to database platform
This commit is contained in:
@@ -2,7 +2,10 @@ package com.avaje.ebean.dbmigration.model;
|
||||
|
||||
import com.avaje.ebean.dbmigration.migration.AddColumn;
|
||||
import com.avaje.ebean.dbmigration.migration.AlterColumn;
|
||||
import com.avaje.ebean.dbmigration.migration.ChangeSet;
|
||||
import com.avaje.ebean.dbmigration.migration.ChangeSetType;
|
||||
import com.avaje.ebean.dbmigration.migration.DropColumn;
|
||||
import com.avaje.ebean.dbmigration.migration.Migration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -49,6 +52,30 @@ public class ModelDiff {
|
||||
return createChanges;
|
||||
}
|
||||
|
||||
public ChangeSet getApplyChangeSet() {
|
||||
// put the changes into a ChangeSet
|
||||
ChangeSet createChangeSet = new ChangeSet();
|
||||
createChangeSet.setType(ChangeSetType.APPLY);
|
||||
createChangeSet.getChangeSetChildren().addAll(createChanges);
|
||||
return createChangeSet;
|
||||
}
|
||||
|
||||
public ChangeSet getDropChangeSet() {
|
||||
// put the changes into a ChangeSet
|
||||
ChangeSet createChangeSet = new ChangeSet();
|
||||
createChangeSet.setType(ChangeSetType.DROP);
|
||||
createChangeSet.getChangeSetChildren().addAll(dropChanges);
|
||||
return createChangeSet;
|
||||
}
|
||||
|
||||
public Migration getMigration() {
|
||||
|
||||
Migration migration = new Migration();
|
||||
migration.getChangeSet().add(getApplyChangeSet());
|
||||
migration.getChangeSet().add(getDropChangeSet());
|
||||
return migration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the list of 'drop' changes.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user