liquibase

Prevent error when dropping not existing sequences, creating existing users

别说谁变了你拦得住时间么 提交于 2019-11-30 09:14:44
问题 I have a bunch of sql scripts that create / drop sequences, users and other objects. I'm running these scripts through liquibase, but they fail because oracle complains when I try to drop a non existing sequence, or create an existing user. Is there an oracle way to prevent errors from happening? Something of the sort Create User / Sequence if not exists Drop User/ Secuence if exists As far as I know, I have these options: Write a plsql script Use liquibase contexts. Use liquibase

Unable to generate difference from liquibase gradle plugin

做~自己de王妃 提交于 2019-11-30 07:31:49
问题 I'm trying to implement liquibase in an existing SpringBoot project with MYSQL database. I want to be able to generate changesets which specify the differences when an entity is changed. What I've done: I've added liquibase dependencies and the gradle liquibase plugin in my build.gradle file. After making a domain change, I've run gradle generateChangeLog . The command executes successfully but nothing happens. I read somewhere that this gradle plugin works only for the inmemory h2 database?

How to get liquibase to log using slf4j?

女生的网名这么多〃 提交于 2019-11-30 06:14:36
A lot of people are unsure how to fix logging for liquibase, either to the console or file. Is it possible to make liquibase log to slf4j? There is, but it is a little bit obscure. Quoting Fixing liquibase logging with SLF4J and Log4J : There's The Easy Way , by dropping in a dependency: <!-- your own standard logging dependencies --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.5</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId><!-- or log4j2 or logback or whatever--> <version>1.7.5</version> <

Refactoring Liquibase changelog files

五迷三道 提交于 2019-11-30 05:45:38
问题 We are using Liquibase for this project I'm working on right now, and all the changelogs are in one big XML-file. Unfortunately, this file has gotten WAY too big - and we want to introduce a "master" file, that includes the original file and any new ones. The old structure: /db/changesets-from-beginning-of-time.xml The new structure: /db/changesets/changesets-from-beginning-of-time.xml /db/changesets/changesets-v.1.2.3.xml /db/changesets/changeset-master.xml The content of the changesets-*

Liquibase on multiple databases

喜欢而已 提交于 2019-11-30 05:24:43
问题 I have already implemented Liquibase with Maven. We are currently using a single database (db2) but now we need to add a new database to the application which will have different objects. I've seen that i can define a new profile in maven but i couldn't find out how to differentiate which objects is being created on which database. Is there a solution to this? Can I support 2 different databases with different objects using liquibase? 回答1: You may want to have 2 separate changelogs to manage

Create databases with liquibase on empty mysql instance

◇◆丶佛笑我妖孽 提交于 2019-11-30 03:29:28
问题 I have fresh mysql instance and want to be able to create a plenty of databases and populate it with liquibase. While I have scripts (changesets) which works fine on manually created databases I want to be able to create databases with liquibase as well. When I try to connect without specifing database in URL I've got the error: liquibase --driver=com.mysql.jdbc.Driver --url=jdbc:mysql://localhost:3306/ --username=root --password=admin --changeLogFile=create_dbs.sql tag empty Unexpected error

How to add new column with default value from existing column in Liquibase

杀马特。学长 韩版系。学妹 提交于 2019-11-29 14:06:26
问题 I'm using Postgres DB and for migration I'm using Liquibase. I have an ORDERS table with the following columns: ID | DATE | NAME | CREATOR | ... I need to add a new column which will hold the user who has last modified the order - this column should be not-nullable and should have default value which is the CREATOR. For new orders I can solve the default value part of the business logic, but thing is I already have an existing orders and I need to set the default value when I create the new

Prevent error when dropping not existing sequences, creating existing users

别等时光非礼了梦想. 提交于 2019-11-29 13:48:22
I have a bunch of sql scripts that create / drop sequences, users and other objects. I'm running these scripts through liquibase, but they fail because oracle complains when I try to drop a non existing sequence, or create an existing user. Is there an oracle way to prevent errors from happening? Something of the sort Create User / Sequence if not exists Drop User/ Secuence if exists As far as I know, I have these options: Write a plsql script Use liquibase contexts. Use liquibase preconditions, but this would mean too much work. Any thoughts / ideas will be greatly appreciated. Nathan Voxland

Unable to generate difference from liquibase gradle plugin

五迷三道 提交于 2019-11-29 07:09:56
I'm trying to implement liquibase in an existing SpringBoot project with MYSQL database. I want to be able to generate changesets which specify the differences when an entity is changed. What I've done: I've added liquibase dependencies and the gradle liquibase plugin in my build.gradle file. After making a domain change, I've run gradle generateChangeLog . The command executes successfully but nothing happens. I read somewhere that this gradle plugin works only for the inmemory h2 database? Is that true? If yes then what alternative should I use to generate changelogs automatically. I could

configure dataSource for liquibase in spring boot

China☆狼群 提交于 2019-11-29 06:51:34
I have a spring boot application and I want to add liquibase configuration change log for it. I have created a LiquibaseConfig class for configuring liquibase: @Configuration public class LiquibaseConfiguration { @Value("${com.foo.bar.liquibase.changelog}") private String changelog; @Autowired MysqlDataSource dataSource; @Bean public SpringLiquibase liquibase() { SpringLiquibase liquibase = new SpringLiquibase(); liquibase.setDataSource(dataSource); liquibase.setChangeLog(changelog); return liquibase; } } and I have configured the datasource information in properties file: spring.datasource