liquibase

Alter sequence in H2

心已入冬 提交于 2020-05-13 05:27:13
问题 I'm using Postgres database in production and H2 for tests. I want to create a new sequence for an existing table - so in Liquibase I wrote this: <changeSet id="Add sequence for BOOKS" author="library"> <createSequence sequenceName="BOOKS_SEQ" incrementBy="500" startValue="1"/> </changeSet> My Entity looks like this: @Entity @Table(name = "BOOKS") @SequenceGenerator(name = "BOOKS_SEQ", allocationSize = 500) public class Book { @Id @GeneratedValue(generator = "BOOKS_SEQ", strategy =

Alter sequence in H2

倖福魔咒の 提交于 2020-05-13 05:27:08
问题 I'm using Postgres database in production and H2 for tests. I want to create a new sequence for an existing table - so in Liquibase I wrote this: <changeSet id="Add sequence for BOOKS" author="library"> <createSequence sequenceName="BOOKS_SEQ" incrementBy="500" startValue="1"/> </changeSet> My Entity looks like this: @Entity @Table(name = "BOOKS") @SequenceGenerator(name = "BOOKS_SEQ", allocationSize = 500) public class Book { @Id @GeneratedValue(generator = "BOOKS_SEQ", strategy =

Alter sequence in H2

邮差的信 提交于 2020-05-13 05:25:58
问题 I'm using Postgres database in production and H2 for tests. I want to create a new sequence for an existing table - so in Liquibase I wrote this: <changeSet id="Add sequence for BOOKS" author="library"> <createSequence sequenceName="BOOKS_SEQ" incrementBy="500" startValue="1"/> </changeSet> My Entity looks like this: @Entity @Table(name = "BOOKS") @SequenceGenerator(name = "BOOKS_SEQ", allocationSize = 500) public class Book { @Id @GeneratedValue(generator = "BOOKS_SEQ", strategy =

Spring Boot 1.4: Executing Method after Liquibase finished

情到浓时终转凉″ 提交于 2020-05-11 04:56:31
问题 I have a Spring Boot 1.4.0 based Project that uses Liquibase. Is it possible to execute a Method AFTER liquibase finished? Something like Bean Post Processor? What i want to do is adding some data to my database when the application is started in development mode. In developement mode the application uses an in-memory h2 database, so liquibase has to create the tables before i can write my data. 回答1: Spring Boot auto-configures a SpringLiquibase bean named liquibase . Any bean that depends on

Passing parameter and value to Gradle liquibase plugin

坚强是说给别人听的谎言 提交于 2020-05-10 06:31:13
问题 I'm using gradle liquibase plugin (https://github.com/liquibase/liquibase-gradle-plugin) but I don't understand how to pass parameters and values. I want build a rollback based on tag and date but I'm only able to rollback on a tag with this command: gradle rollback -DliquibaseTag=value I don't understand how I should pass data, tag or count. My grade.build is very simple: apply plugin: 'liquibase' buildscript { repositories { mavenLocal() mavenCentral() } dependencies { classpath 'org

Passing parameter and value to Gradle liquibase plugin

随声附和 提交于 2020-05-10 06:26:27
问题 I'm using gradle liquibase plugin (https://github.com/liquibase/liquibase-gradle-plugin) but I don't understand how to pass parameters and values. I want build a rollback based on tag and date but I'm only able to rollback on a tag with this command: gradle rollback -DliquibaseTag=value I don't understand how I should pass data, tag or count. My grade.build is very simple: apply plugin: 'liquibase' buildscript { repositories { mavenLocal() mavenCentral() } dependencies { classpath 'org

How to set up liquibase in Spring for multiple data sources?

你离开我真会死。 提交于 2020-05-09 18:53:31
问题 I need to set up liquibase for two datasources in Spring , at the moment it seems that only one liquibase set up is possible and you can choose for which data source. 回答1: If you are using spring boot, here is the setup which can help you: Configuration class: @Configuration public class DatasourceConfig { @Primary @Bean @ConfigurationProperties(prefix = "datasource.primary") public DataSource primaryDataSource() { return DataSourceBuilder.create().build(); } @Bean @ConfigurationProperties

聊聊Spring Boot Actuator

不羁的心 提交于 2020-04-29 15:53:28
概述 在本文中,我们将介绍Spring Boot Actuator。我们将首先介绍基础知识,然后详细讨论Spring Boot 1.x和2.x中的可用内容。 我们将在Spring Boot 1.x中学习如何使用,配置和扩展此监视工具。然后,我们将讨论如何利用反应式编程模型使用Boot 2.x和WebFlux进行相同的操作。 自2014年4月起,Spring Boot Actuator随Spring Boot一起发布。 随着SpringBoot2的发布,执行器进行了重新设计,并添加了新的激动人心的端点。本指南分为三个主要部分: 什么是执行器(Actuator) Spring Boot 1.x Actuator Spring Boot 2.x Actuator 👋: 执行器==Actuator 什么是执行器(Actuator) 本质上,执行器为我们的应用带来了生产就绪功能。 通过对他的依赖,监视我们的应用程序、收集度量、了解流量或数据库的状态变得轻松简单: 这个库的主要好处是,我们可以获得生产级工具,而不必亲自实现这些功能。Actuator主要用于公开有关正在运行的应用程序的操作信息-运行状况,指标,信息,转储,环境等。它使用HTTP端点或JMX Bean使我们能够与其交互。一旦在类路径上使用执行器,便可以立即使用几个端点。与大多数Spring模块一样

Tests not working for multiple datasource with spring boot liquibase

落爺英雄遲暮 提交于 2020-04-17 22:41:35
问题 I am creating unittesting for spring boot application having multiple datasources. (Configuration is heavily inspired from this answer) @Configuration public class DatasourceConfig { @Primary @Bean @ConfigurationProperties(prefix = "datasource.primary") public DataSource primaryDataSource() { return DataSourceBuilder.create().build(); } @Bean @ConfigurationProperties(prefix = "datasource.primary.liquibase") public LiquibaseProperties primaryLiquibaseProperties() { return new

Tests not working for multiple datasource with spring boot liquibase

▼魔方 西西 提交于 2020-04-17 22:41:11
问题 I am creating unittesting for spring boot application having multiple datasources. (Configuration is heavily inspired from this answer) @Configuration public class DatasourceConfig { @Primary @Bean @ConfigurationProperties(prefix = "datasource.primary") public DataSource primaryDataSource() { return DataSourceBuilder.create().build(); } @Bean @ConfigurationProperties(prefix = "datasource.primary.liquibase") public LiquibaseProperties primaryLiquibaseProperties() { return new