Annotation Type DbMigration


@Retention(RUNTIME) @Target(FIELD) @Repeatable(List.class) public @interface DbMigration
Annotation to specify details for DDL & Migration-generation. (e.g. defaults/renames/...) This annotation is EXPERIMENTAL and may change.
Author:
Roland Praml, FOCONIS AG
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Repeatable support for DbMigration.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specific platforms this migration change applies to.
    DdlScript that will be executed after the 'add' command.
    DdlScript that will be executed after the 'alter' command
    DdlScript that will be executed before the 'add' command
    DdlScripts that will be executed before the 'alter' command.
  • Element Details

    • preAlter

      String[] preAlter
      DdlScripts that will be executed before the 'alter' command.

      You may write a custom update routine here. If you do not specify an SQL here, and this will alter the table to a non-null column, ebean will autogenerate a statement from default value like this:

       UPDATE table SET column = 'foo' WHERE column IS NULL
       
      Default:
      {}
    • postAlter

      String[] postAlter
      DdlScript that will be executed after the 'alter' command
      Default:
      {}
    • preAdd

      String[] preAdd
      DdlScript that will be executed before the 'add' command
      Default:
      {}
    • postAdd

      String[] postAdd
      DdlScript that will be executed after the 'add' command. You may write certain update scripts here.
      Default:
      {}
    • platforms

      Platform[] platforms
      Specific platforms this migration change applies to.
      Default:
      {}