Package io.ebean.migration.auto
Interface AutoMigrationRunner
-
public interface AutoMigrationRunner
Automatically run DB Migrations on application start.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidloadProperties(Properties properties)Load configuration properties.voidrun(DataSource dataSource)Run DB migrations using the given DataSource.default voidsetBasePlatform(String basePlatform)Set the base platform for running the migration.voidsetDefaultDbSchema(String defaultDbSchema)Set a default DB schema to use.voidsetName(String name)Set the name of the database the migration is run for.default voidsetPlatform(String platform)Set the platform for running the migration.
-
-
-
Method Detail
-
setName
void setName(String name)
Set the name of the database the migration is run for.This name can be used when loading properties like:
ebean.${name}.migration.migrationPath
-
setDefaultDbSchema
void setDefaultDbSchema(String defaultDbSchema)
Set a default DB schema to use.This is mostly for Postgres use where the dbSchema matches the DB username. In this case we don't set the current schema as that can mess up the Postgres search path.
-
loadProperties
void loadProperties(Properties properties)
Load configuration properties.
-
setPlatform
default void setPlatform(String platform)
Set the platform for running the migration.In the case where we have migrations for many platforms this defines the associated platform that is being used to run the migration.
-
setBasePlatform
default void setBasePlatform(String basePlatform)
Set the base platform for running the migration.For example, with sqlserver17 the base platform is "sqlserver" and platform is "sqlserver17". Similarly, with db2luw the base platform is "db2" and the platform is "db2luw".
The migration runner can look for migrations to run based on the base platform or specific platform.
-
run
void run(DataSource dataSource)
Run DB migrations using the given DataSource.
-
-