Package ch.tocco.nice2.dbrefactoring.api
Interface SchemaService
- All Known Implementing Classes:
SchemaServiceImpl
public interface SchemaService
Service for dealing with database schema.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createDatabaseSchemaDDL
(ChangelogType type, InstallParameters params, @Nullable String contexts, Writer out) Using the schema database changelog of all modules, this will create the SQL DDL statements needed to update the current database, while "current database" is the end of the connection obtained from the default data source.void
createDatabaseSchemaDDL
(File changelog, InstallParameters params, @Nullable String contexts, Writer out) Generates SQL DDL statements for the given changelog file.liquibase.Liquibase
createLiquibase
(Connection connection, File changelog, boolean ignoreErrors, ProgressLogger logger) void
updateDatabaseSchema
(ChangelogType type, InstallParameters params, @Nullable String contexts) Runs the consolidated schema changelog of all current modules against the database of the default datasource.void
updateDatabaseSchema
(File changelog, InstallParameters params, @Nullable String contexts) Updates the database at the specified connection with SQL statements obtained from the given changelog file.void
updateDatabaseSchema
(liquibase.Liquibase liquibase, InstallParameters params, @Nullable String contexts)
-
Method Details
-
createDatabaseSchemaDDL
void createDatabaseSchemaDDL(ChangelogType type, InstallParameters params, @Nullable @Nullable String contexts, Writer out) throws DbRefactoringException Using the schema database changelog of all modules, this will create the SQL DDL statements needed to update the current database, while "current database" is the end of the connection obtained from the default data source.
If the current database is empty, the script will create the whole schema from scratch, otherwise it tries to perform an upgrade to current state.
The SQL statements are written to the specified writer.
- Parameters:
type
- the changelog type- Throws:
DbRefactoringException
-
createDatabaseSchemaDDL
void createDatabaseSchemaDDL(File changelog, InstallParameters params, @Nullable @Nullable String contexts, Writer out) throws DbRefactoringException Generates SQL DDL statements for the given changelog file.- Throws:
DbRefactoringException
-
updateDatabaseSchema
void updateDatabaseSchema(ChangelogType type, InstallParameters params, @Nullable @Nullable String contexts) throws DbRefactoringException Runs the consolidated schema changelog of all current modules against the database of the default datasource.- Parameters:
type
- the changelog type- Throws:
DbRefactoringException
-
updateDatabaseSchema
void updateDatabaseSchema(File changelog, InstallParameters params, @Nullable @Nullable String contexts) throws DbRefactoringException Updates the database at the specified connection with SQL statements obtained from the given changelog file.- Throws:
DbRefactoringException
-
updateDatabaseSchema
void updateDatabaseSchema(liquibase.Liquibase liquibase, InstallParameters params, @Nullable @Nullable String contexts) throws DbRefactoringException - Throws:
DbRefactoringException
-
createLiquibase
liquibase.Liquibase createLiquibase(Connection connection, File changelog, boolean ignoreErrors, ProgressLogger logger) throws liquibase.exception.LiquibaseException - Throws:
liquibase.exception.LiquibaseException
-