mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#955 - Migration "add column" DDL with check constraint is missing constraint name
This commit is contained in:
@@ -43,6 +43,14 @@ public class BaseDdlHandlerTest extends BaseTestCase {
|
||||
assertThat(write.apply().getBuffer()).isEqualTo("alter table foo add column added_to_foo varchar(20);\n\n");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void addColumn_withCheckConstraint() throws Exception {
|
||||
|
||||
DdlWrite write = new DdlWrite();
|
||||
h2Handler().generate(write, Helper.getAlterTableAddColumnWithCheckConstraint());
|
||||
assertThat(write.apply().getBuffer()).isEqualTo("alter table foo add column status integer constraint ck_ordering_status check ( status in (0,1));\n\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Test the functionality of the Ebean {@literal @}DbArray extension during DDL generation.
|
||||
*/
|
||||
|
||||
@@ -71,6 +71,10 @@ public class Helper {
|
||||
return (AddColumn) alterTableChangeSetChildren.get(4);
|
||||
}
|
||||
|
||||
public static AddColumn getAlterTableAddColumnWithCheckConstraint() {
|
||||
return (AddColumn) alterTableChangeSetChildren.get(5);
|
||||
}
|
||||
|
||||
public static DropColumn getDropColumn() {
|
||||
return (DropColumn) changeSetChildren.get(2);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user