ebean icon indicating copy to clipboard operation
ebean copied to clipboard

ENH: Add @DbComment with DDL generation of table and column comments

Open archer-christ opened this issue 11 years ago • 6 comments

using FileWriter may cause messy code when write out see# com.avaje.ebeaninternal.server.ddl.DdlGenerator.writeFile maybe should use FileOutputStream to solve this

/* FileWriter fw = new FileWriter(f);
try {
  fw.write(fileContent);
  fw.flush();
} finally {
  fw.close();
}*/

FileOutputStream out = null;
try {
  out = new FileOutputStream(f, false);
  out.write(fileContent.getBytes("UTF-8"));
  out.flush();
} finally {
  out.close();
}

archer-christ avatar Aug 01 '15 09:08 archer-christ

What do you mean by 'messy code'? Do you mean some problem with UTF8 encoding?

rbygrave avatar Aug 01 '15 20:08 rbygrave

As below, the COMMENT will be ??? or some other messy code generated , not the UTF8 encoding
@Column(columnDefinition = "varchar(30) COMMENT'角色名称'") private String name;

archer-christ avatar Aug 02 '15 02:08 archer-christ

Additionally , Can Ebean provide annotation @Comment to add COMMENT to table gen ,not the current way in the columnDefinition part

archer-christ avatar Aug 02 '15 02:08 archer-christ

DB Migration has column comments? @rbygrave

icode avatar Dec 09 '15 04:12 icode

Yes but they are not used in 'diff'.

On 9 December 2015 at 17:31, icode [email protected] wrote:

DB Migration has column comments? @rbygrave https://github.com/rbygrave

— Reply to this email directly or view it on GitHub https://github.com/ebean-orm/avaje-ebeanorm/issues/365#issuecomment-163106514 .

rbygrave avatar Dec 09 '15 04:12 rbygrave

I don't understand for DbMigration, DbMigration how to know the current database versio? I'm not see a dbversion table.

icode avatar Dec 09 '15 04:12 icode