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:
@@ -1,12 +1,11 @@
|
||||
package com.avaje.ebean.dbmigration;
|
||||
|
||||
import com.avaje.ebean.BaseTestCase;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class DbMigrationTest extends BaseTestCase {
|
||||
|
||||
@@ -22,7 +21,7 @@ public class DbMigrationTest extends BaseTestCase {
|
||||
DbMigration migration = new DbMigration();
|
||||
DbOffline.reset();
|
||||
|
||||
migration.writeCurrent();
|
||||
//migration.writeCurrent();
|
||||
|
||||
assertThat(DbOffline.isSet()).isFalse();
|
||||
|
||||
|
||||
+4
-3
@@ -4,7 +4,7 @@ package com.avaje.ebean.dbmigration.model.build;
|
||||
import com.avaje.ebean.BaseTestCase;
|
||||
import com.avaje.ebean.Ebean;
|
||||
import com.avaje.ebean.config.DbConstraintNaming;
|
||||
import com.avaje.ebean.dbmigration.ddlgeneration.platform.PlatformDdl;
|
||||
import com.avaje.ebean.dbmigration.ddlgeneration.platform.DefaultConstraintMaxLength;
|
||||
import com.avaje.ebeaninternal.api.SpiEbeanServer;
|
||||
import com.avaje.ebean.dbmigration.model.MTable;
|
||||
import com.avaje.ebean.dbmigration.model.ModelContainer;
|
||||
@@ -22,9 +22,10 @@ public class ModelBuildBeanVisitorTest extends BaseTestCase {
|
||||
|
||||
ModelContainer model = new ModelContainer();
|
||||
|
||||
PlatformDdl platformDdl = defaultServer.getDatabasePlatform().getPlatformDdl();
|
||||
DbConstraintNaming constraintNaming = defaultServer.getServerConfig().getConstraintNaming();
|
||||
ModelBuildContext ctx = new ModelBuildContext(model, constraintNaming, platformDdl);
|
||||
|
||||
DefaultConstraintMaxLength maxLength = new DefaultConstraintMaxLength(60);
|
||||
ModelBuildContext ctx = new ModelBuildContext(model, constraintNaming, maxLength);
|
||||
|
||||
ModelBuildBeanVisitor addTable = new ModelBuildBeanVisitor(ctx);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user