#374 - Move db constraint max length to database platform

This commit is contained in:
Robin Bygrave
2015-08-14 17:06:08 +12:00
parent 60c1a5b111
commit 215417a43c
27 changed files with 587 additions and 1432 deletions
@@ -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.
*/