Annotation Type Migration


@Retention(CLASS) @Target(TYPE) public @interface Migration

Marks a com.codename1.migration.JavaMigration the build should register beside the project's SQL migration files.

The class needs a public no-argument constructor. It runs once, in version order with the scripts, and its version must not be one a script already uses.

@Migration(version = "4", description = "normalize phone numbers")
public class NormalizePhones implements JavaMigration {
    public void migrate(MigrationContext context) throws IOException {
        // ...
    }
}
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    What the migration does; recorded in the schema history.
    The version, such as 4 or 2026.05.21.1.
  • Element Details

    • version

      String version
      The version, such as 4 or 2026.05.21.1.
    • description

      String description
      What the migration does; recorded in the schema history.