mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1937 - When add a new col with @DbComment in Entity,the DbMigration does not generate comment ddl
This commit is contained in:
+16
@@ -19,6 +19,7 @@ import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
|
||||
public class BaseTableDdlTest {
|
||||
@@ -98,6 +99,21 @@ public class BaseTableDdlTest {
|
||||
assertThat(ddl).contains("comment on column mytab.acol is 'my comment'");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void alterTableAddColumnWithComment() throws IOException {
|
||||
BaseTableDdl ddl = new BaseTableDdl(serverConfig, h2ddl);
|
||||
DdlWrite write = new DdlWrite();
|
||||
Column column = new Column();
|
||||
column.setName("my_column");
|
||||
column.setComment("some comment");
|
||||
column.setType("int");
|
||||
|
||||
ddl.alterTableAddColumn(write.apply(), "my_table", column, false, false);
|
||||
assertEquals(
|
||||
"alter table my_table add column my_column int;\n" +
|
||||
"comment on column my_table.my_column is 'some comment';\n", write.apply().getBuffer());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAddTableComment() throws IOException {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user