Class SchemaServiceImpl
java.lang.Object
ch.tocco.nice2.dbrefactoring.impl.SchemaServiceImpl
- All Implemented Interfaces:
SchemaService
-
Constructor Summary
ConstructorsConstructorDescriptionSchemaServiceImpl(ChangelogService changelogService, DataSource dataSource, RunEnvironmentService runEnvironmentService) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateDatabaseSchemaDDL(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.voidcreateDatabaseSchemaDDL(File changelog, InstallParameters params, @Nullable String contexts, Writer out) Generates SQL DDL statements for the given changelog file.liquibase.LiquibasecreateLiquibase(Connection connection, File changelog, boolean ignoreErrors, ProgressLogger logger) voidsetCustomChanges(List<CustomChangeContribution> classes) voidsetRemoveChangeLogLock(boolean removeChangeLogLock) voidupdateDatabaseSchema(ChangelogType type, InstallParameters params, @Nullable String contexts) Runs the consolidated schema changelog of all current modules against the database of the default datasource.voidupdateDatabaseSchema(File changelog, InstallParameters params, @Nullable String contexts) Updates the database at the specified connection with SQL statements obtained from the given changelog file.voidupdateDatabaseSchema(liquibase.Liquibase liquibase, InstallParameters params, @Nullable String contexts)
-
Constructor Details
-
SchemaServiceImpl
public SchemaServiceImpl(ChangelogService changelogService, DataSource dataSource, RunEnvironmentService runEnvironmentService)
-
-
Method Details
-
setCustomChanges
-
createDatabaseSchemaDDL
public void createDatabaseSchemaDDL(ChangelogType type, InstallParameters params, @Nullable @Nullable String contexts, Writer out) throws DbRefactoringException Description copied from interface:SchemaServiceUsing 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.
- Specified by:
createDatabaseSchemaDDLin interfaceSchemaService- Parameters:
type- the changelog type- Throws:
DbRefactoringException
-
createDatabaseSchemaDDL
public void createDatabaseSchemaDDL(File changelog, InstallParameters params, @Nullable @Nullable String contexts, Writer out) throws DbRefactoringException Description copied from interface:SchemaServiceGenerates SQL DDL statements for the given changelog file.- Specified by:
createDatabaseSchemaDDLin interfaceSchemaService- Throws:
DbRefactoringException
-
updateDatabaseSchema
public void updateDatabaseSchema(ChangelogType type, InstallParameters params, @Nullable @Nullable String contexts) throws DbRefactoringException Description copied from interface:SchemaServiceRuns the consolidated schema changelog of all current modules against the database of the default datasource.- Specified by:
updateDatabaseSchemain interfaceSchemaService- Parameters:
type- the changelog type- Throws:
DbRefactoringException
-
updateDatabaseSchema
public void updateDatabaseSchema(File changelog, InstallParameters params, @Nullable @Nullable String contexts) throws DbRefactoringException Description copied from interface:SchemaServiceUpdates the database at the specified connection with SQL statements obtained from the given changelog file.- Specified by:
updateDatabaseSchemain interfaceSchemaService- Throws:
DbRefactoringException
-
updateDatabaseSchema
public void updateDatabaseSchema(liquibase.Liquibase liquibase, InstallParameters params, @Nullable @Nullable String contexts) throws DbRefactoringException - Specified by:
updateDatabaseSchemain interfaceSchemaService- Throws:
DbRefactoringException
-
createLiquibase
public liquibase.Liquibase createLiquibase(Connection connection, File changelog, boolean ignoreErrors, ProgressLogger logger) throws liquibase.exception.LiquibaseException - Specified by:
createLiquibasein interfaceSchemaService- Throws:
liquibase.exception.LiquibaseException
-
setRemoveChangeLogLock
@Value("${nice2.dbrefactoring.removeChangeLogLock}") public void setRemoveChangeLogLock(boolean removeChangeLogLock)
-