public interface DatabaseSchemaService
Database schema service which provides methods to create, validate ,upgrade and drop the schema.
Modifier and Type | Method and Description |
---|---|
void |
create()
Creates the database schema, upgrading an existing schema if it is present.
|
void |
drop()
Drops the database schema.
|
DatabaseSchemaStatus<org.flywaydb.core.api.MigrationInfo> |
getStatus()
Returns the status of the database schema.
|
boolean |
isNewSchema()
Checks whether the database initialization created a new schema.
|
void |
setListeners(DatabaseSchemaServiceListener... databaseSchemaServiceListener)
Set the
DatabaseSchemaServiceListener which gets called before and after each operation. |
void |
validate()
Validates the database schema and checks if the codebase is able to use the schema.
|
void create()
Creates the database schema, upgrading an existing schema if it is present.
DatabaseSchemaException
- if there was an error creating the schemavoid validate()
Validates the database schema and checks if the codebase is able to use the schema.
DatabaseSchemaException
- if the database schema is not validvoid drop()
Drops the database schema.
DatabaseSchemaException
- if there was an error dropping the schemaDatabaseSchemaStatus<org.flywaydb.core.api.MigrationInfo> getStatus()
Returns the status of the database schema.
DatabaseSchemaException
- if there was an error getting the status of the schemavoid setListeners(DatabaseSchemaServiceListener... databaseSchemaServiceListener)
Set the DatabaseSchemaServiceListener
which gets called before and after each operation.
databaseSchemaServiceListener
- the database schema service listenerboolean isNewSchema()
Checks whether the database initialization created a new schema.
this will only return the correct value after the Flyway migration has been triggered and the baseline migration has been applied.
true
if the Flyway migration involved the creation of a new schema (baseline applied)Copyright © 2010 - 2019 edorasware ag. All Rights Reserved.