Class MigrationSet
java.lang.Object
com.codename1.migration.MigrationSet
A named group of migrations with its own history table.
An application has one, called default, which the build fills from the migration files in
the project. A library that needs tables of its own registers a second set under its own name
and history table, so its versions never collide with the application's.
MigrationSet set = MigrationSet.builder("default")
.sql("1", "create notes", "CREATE TABLE notes (id INTEGER PRIMARY KEY, body TEXT)")
.sql("2", "add created", "ALTER TABLE notes ADD COLUMN created INTEGER")
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classCollects the migrations of a set. -
Field Summary
Fields -
Method Summary
-
Field Details
-
DEFAULT_NAME
-
DEFAULT_TABLE
-
-
Method Details
-
builder
Starts a set.- Parameters:
name-defaultfor the application's own migrations, otherwise a short lower-case identifier naming the library- Returns:
- a builder
-
getName
-
getTable
The history table of the set.- Returns:
flyway_schema_historyfor the default set andcn1_<name>_schema_historyfor any other, unless the builder named one
-
isDefault
public boolean isDefault()Whether this is the application's own set.- Returns:
- true for the set called
default
-