liquibase

Flyway对比Liquibase(转)

核能气质少年 提交于 2019-12-02 10:41:05
数据库迁移工具. 很多应用的运行是需要数据库支持的,而随着快速迭代,产品更替的节奏加快,除了产品本身需要不断更新以外,数据库也需要做出合适的管理了。 为什么需要数据库迁移管理 比如第一个版本的产品只包含了最基本的功能,而第二版本就需要增加评论功能,这就涉及到数据结构的修改(包括创建新表,修改旧表的列,增加已有表的列等等)。直接进入产品数据库修改数据库并不适合快速的开发节奏,不仅仅不安全,更多的情况下数据库可能并不对外或者并不适合对外直接暴露连接,比如PAAS平台的数据库以服务的形式直接提供。 对比代码管理的一些实践,很明显在数据库方面做的还欠缺很多。比如代码管理中我们有 版本管理(svn,git等等) 持续集成技术 良好的发布工具和流程 而在数据库方面会遇到很多问题 某台数据库现在是什么状态 修改变更的脚本是否已经应用 对于生产环境的紧急修复有没有被应用在测试环境 如何创建一个新的数据库实例 数据库迁移工具可以很好的管理这些问题,并提供了以下特性 从迁移脚本中创建新的数据库 检查数据库状态 从一个版本快速到达另外一个版本 Flyway和Liquibase 数据库迁移工具很多,这里我们选择Flyway和Liquibase来说主要是两个原因,一是它们都是Java生态圈的,其次就是Spring Boot提供了这两者的内建支持,可以很快应用到产品中。 Flyway相对简单

Running Liquibase with CDI on Wildfly 8

血红的双手。 提交于 2019-12-02 08:54:55
问题 I am trying to run Liquibase scripts using CDI on WildFly 8.1.0.Final and I am getting this error: Unsatisfied dependencies for type ResourceAccessor with qualifiers @LiquibaseType My POM has these dependencies: <dependencies> <dependency> <groupId>org.liquibase</groupId> <artifactId>liquibase-core</artifactId> <version>3.3.0</version> </dependency> <dependency> <groupId>org.liquibase</groupId> <artifactId>liquibase-cdi</artifactId> <version>3.3.0</version> </dependency> <dependency> <groupId

How to declare a variable and mysql update in liquibase

萝らか妹 提交于 2019-12-02 07:06:22
问题 I want to write the following sql code in liquibase set @value1 = "string1"; set @value2 = "string2"; update users set category = REPLACE(category, @value1, @value2); How to write this in liquibase either in xml or in sql file? 回答1: The @value syntax is part of the MySQL SQL editor tools and not actually understood by the database itself so liquibase is not able to take advantage of them. Liquibase does support similar functionality with changelog paramaters using the syntax ${value} 回答2: If

Running Liquibase with CDI on Wildfly 8

此生再无相见时 提交于 2019-12-02 06:28:21
I am trying to run Liquibase scripts using CDI on WildFly 8.1.0.Final and I am getting this error: Unsatisfied dependencies for type ResourceAccessor with qualifiers @LiquibaseType My POM has these dependencies: <dependencies> <dependency> <groupId>org.liquibase</groupId> <artifactId>liquibase-core</artifactId> <version>3.3.0</version> </dependency> <dependency> <groupId>org.liquibase</groupId> <artifactId>liquibase-cdi</artifactId> <version>3.3.0</version> </dependency> <dependency> <groupId>com.mattbertolini</groupId> <artifactId>liquibase-slf4j</artifactId> <version>1.2.1</version> <

The web application [ROOT] appears to have started a thread named [pollingConfigurationSource] but has failed to stop it. Memory leak

流过昼夜 提交于 2019-12-02 04:52:09
Hi i am getting memory leak error while running project. I am using spring boot + quards scheduler + liquibase + postgreSQL 9.6 . These are technologies we are using. Error: 12018-10-15 11:43:19.005 WARN [billing,,,] 19152 --- [ost-startStop-1] o.a.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [pollingConfigurationSource] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: sun.misc.Unsafe.park(Native Method) java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215) java.util.concurrent

SpringBoot--数据库管理与迁移(LiquiBase)

做~自己de王妃 提交于 2019-12-02 03:26:07
  随着开发时间积累,一个项目会越来越大,同时表结构也越来越多,管理起来比较复杂,特别是当想要把一个答的项目拆分成多个小项目时,表结构拆分会耗很大的精力;如果使用LiquiBase对数据库进行管理,那么就会大大提升迁移效率,还是以刚才的拆分项目为例,如果使用Liquibase,则只需要将指定模块的表文件迁移走即可。   接下来就是使用Springboot实现Liquibase。   1、导入依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> <dependency> <groupId>org.liquibase</groupId> <artifactId>liquibase-core</artifactId> </dependency>   2、配置项 spring: profiles:  active: test datasource: url: jdbc:mysql://***.76:3306

How to declare a variable and mysql update in liquibase

半城伤御伤魂 提交于 2019-12-02 03:18:32
I want to write the following sql code in liquibase set @value1 = "string1"; set @value2 = "string2"; update users set category = REPLACE(category, @value1, @value2); How to write this in liquibase either in xml or in sql file? The @value syntax is part of the MySQL SQL editor tools and not actually understood by the database itself so liquibase is not able to take advantage of them. Liquibase does support similar functionality with changelog paramaters using the syntax ${value} Aaron If you want to declare and set variables within a changeset's 'sql' tag you just need to remove the ";". By

liquibase:diff not giving me expected result

送分小仙女□ 提交于 2019-12-01 13:32:04
I have a JPA entity called customer and goes like this @Entity public class Customer { private int custNo; private String custName; private String country; public Customer() { } public Customer(int custNumber, String custName, String country) { this.custNo = custNumber; this.custName = custName; this.country = country; } public int getCustNo() { return custNo; } public void setCustNo(int custNo) { this.custNo = custNo; } public String getCustName() { return custName; } public void setCustName(String custName) { this.custName = custName; } public String getCountry() { return country; } public

Spring boot 1.5.2 - web application stops after loading logo?

给你一囗甜甜゛ 提交于 2019-12-01 05:27:48
I have a very weird problem with Spring Boot, I don't know why the web application which using Spring Boot cannot start and it has no output error even when I run it directly on the terminal. java -jar /var/lib/tomcat/webapps/rasdaman.war log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. . ____ _ __ _ _ /\ / ' __ _ () __ __ _ \ \ \ ( ( )__ | '_ | '| | ' / ` | \ \ \ \/ )| |)| | | | | || (

Spring boot 1.5.2 - web application stops after loading logo?

白昼怎懂夜的黑 提交于 2019-12-01 02:17:53
问题 I have a very weird problem with Spring Boot, I don't know why the web application which using Spring Boot cannot start and it has no output error even when I run it directly on the terminal. java -jar /var/lib/tomcat/webapps/rasdaman.war log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info