liquibase

using spring boot profiles with liquibase changeset context attribute to manage changset scope

北城以北 提交于 2020-01-04 11:04:27
问题 I am trying to do a proof of concept application with spring boot and liquibase. I basically want to create a spring boot app that can manage liquibase changesets by utilizing the changeset attribute called context, so that changesets with no context can be applied to any spring boot profile, whereas changesets with specific context (e.g context="dev" ) will only be applied if spring boot profiles of that type, is active (e.g spring.profiles.active=dev). In my app, i have the following spring

Liquibase - common columns?

回眸只為那壹抹淺笑 提交于 2020-01-04 10:36:46
问题 In my db every table has 4 common columns - DATE_CREATED , USER_CREATED , DATE_MODIFIED , USER_MODIFIED , and I want to propagate this rule to all new tables implicitly. Is it possible to do it without having to generate liquibase script manually? 回答1: This is not possible using liquibase (as far as I know). The reason for this is simple: What if you change your mind and add/remove one of the default columns later? If you want to change all tables then this is not possible with liquibase as

Liquibase - common columns?

时光毁灭记忆、已成空白 提交于 2020-01-04 10:36:21
问题 In my db every table has 4 common columns - DATE_CREATED , USER_CREATED , DATE_MODIFIED , USER_MODIFIED , and I want to propagate this rule to all new tables implicitly. Is it possible to do it without having to generate liquibase script manually? 回答1: This is not possible using liquibase (as far as I know). The reason for this is simple: What if you change your mind and add/remove one of the default columns later? If you want to change all tables then this is not possible with liquibase as

Liquibase - common columns?

我是研究僧i 提交于 2020-01-04 10:35:06
问题 In my db every table has 4 common columns - DATE_CREATED , USER_CREATED , DATE_MODIFIED , USER_MODIFIED , and I want to propagate this rule to all new tables implicitly. Is it possible to do it without having to generate liquibase script manually? 回答1: This is not possible using liquibase (as far as I know). The reason for this is simple: What if you change your mind and add/remove one of the default columns later? If you want to change all tables then this is not possible with liquibase as

Liquibase Rollback Spring boot

淺唱寂寞╮ 提交于 2020-01-04 05:50:34
问题 I have a microservice built using spring boot. I integrated the Liquibase and it execute all changeSet s except rollback s. Below is the sample liquibase xml file. <changeSet id="6" author="Kasun"> <insert tableName="user"> <column name="firstNale" value="Kasun" ></column> <column name="lastName" value="Ranasinghe" ></column> </insert> </changeSet> <changeSet id="7" author="Kasun"> <rollback changeSetAuthor="Kasun" > <createTable tableName="user" /> </rollback> </changeSet> When I run the

Multiple liquibase configurations in spring boot

别等时光非礼了梦想. 提交于 2020-01-03 08:48:11
问题 I have spring boot application which use 2 databases. I defined 2 configurations providing specified datasources. I want to have that datasources managed separately by liquibase. I defined 2 separated changelog files. The problem is that I can't define 2 separate beans for liquibase. Here are my config classes: ... public class CCSConfiguration { ... @Bean @ConfigurationProperties("ccs.liquibase") public LiquibaseProperties ccsLiquibaseProperties() { return new LiquibaseProperties(); } @Bean

Grails 3 database-migration-plugin initialization error

£可爱£侵袭症+ 提交于 2020-01-02 04:15:11
问题 I recently added database-migration-plugin to my grails 3.0.11 app. The problem is when I try to run-app I get a following error: ERROR grails.boot.GrailsApp - Application startup failed Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springLiquibase_dataSource': Invocation of init method failed; nested exception is liquibase.exception.ChangeLogParseException: java.lang.IllegalArgumentException: Script text to compile cannot

How to create liquibase changeset for integration tests in springboot?

半世苍凉 提交于 2020-01-02 03:44:31
问题 I want mock data for integration tests by liquibase changeset, how to make that to not affect real database? I found partial idea from here, but I am using springboot and I hope there is simpler solution. 回答1: Hi you can use liquibase's context parameter. For example create changeset which will have inserts loaded from sql file and specify the context for it. something like this: <changeSet id="test_data_inserts" author="me" context="test"> <sqlFile path="test_data.sql"

PL/SQL and SQL script in one sqlFile with liquibase?

雨燕双飞 提交于 2020-01-01 09:37:08
问题 I try very lot options to run in room changeSet/sqlFile which contains pl/sql block and simlple sql statement. E.g.: BEGIN aud.someProcedure('parameter'); END; / insert into test_table(_id, value) VALUES(1, 'test'); But I get the following exception: liquibase.exception.MigrationFailedException: Migration failed for change set [xml path]: Reason: liquibase.exception.DatabaseException: ORA-06550: 4 line, 1 col: PLS-00103: Encountered the symbol: "/" [Failed SQL: BEGIN aud.someProcedure(

Loading data from properties file to be used by Liquibase in Maven build

做~自己de王妃 提交于 2019-12-31 10:45:12
问题 I can run Liquibase changelog through maven build ( liquibase:update goal) without any problems. Now I'd like Liquibase to use database credentials and URL loaded from a properties file ( db.properties ) depending on the selected Maven profile: |-- pom.xml `-- src `-- main `-- resources |-- local | `-- db.properties |-- dev | `-- db.properties |-- prod | `-- db.properties `-- db-changelog-master.xml `-- db-changelog-1.0.xml Each of the 3 properties files would look like the following: