liquibase

Liquibase rollback from command line not working

点点圈 提交于 2021-02-19 07:32:50
问题 I am doing an tomcat appliaction in a windows enviroment that when deployed creates/updates the DB Schema on the oracle db. For this I am using the Liquibase SDK 3.3.2. So basically I call the SDK an tell it to do an update from my changelog.xml. This parts works as fine. The code form the java class ... Liquibase liquibase = new Liquibase(CHANGE_LOG, new ClassLoaderResourceAccessor(getClass().getClassLoader()), db); liquibase.update(""); The problem is, when something goes wrong and I do a

Check constraint on table in liquibase

不想你离开。 提交于 2021-02-16 21:07:26
问题 I want to create a check constraint on a table using liquibase, this is the check constaint : alter table userprefs add constraint chk_null CHECK (updatedate IS NOT NULL OR updateuser IS NOT NULL); I googled about it but all I can find is how to create the check constraint on a column. How this is can be done on liquibase ? 回答1: Liquibase does not support check constraints "natively". You need to put that into a <sql> tag: <changeSet author="ichigo" id="1"> <sql> alter table userprefs add

Check constraint on table in liquibase

≯℡__Kan透↙ 提交于 2021-02-16 21:07:17
问题 I want to create a check constraint on a table using liquibase, this is the check constaint : alter table userprefs add constraint chk_null CHECK (updatedate IS NOT NULL OR updateuser IS NOT NULL); I googled about it but all I can find is how to create the check constraint on a column. How this is can be done on liquibase ? 回答1: Liquibase does not support check constraints "natively". You need to put that into a <sql> tag: <changeSet author="ichigo" id="1"> <sql> alter table userprefs add

JHipster H2 DB Non-admin User

喜夏-厌秋 提交于 2021-02-11 12:33:39
问题 I am trying to run my spring-boot/liquibase/H2 database with a non-admin user and am having some problems understanding how to do this. First off, I have seen some information here and tried to set up my application.yml this way. datasource: type: com.zaxxer.hikari.HikariDataSource url: jdbc:h2:mem:test username: USERLIMITED password: user_limited_password liquibase: contexts: dev, faker user: THELIQUIBASEUSER password: THELIQUIBASEPASSWORD Also put these sql statements in the changelog to

Liquibase in Spring boot application keeps 10 connections open

北城余情 提交于 2021-02-11 07:21:05
问题 I'm working on a Spring Boot application with Liquibase integration to setup the database. We use a different user for the database changes which we configured using the application.properties file liquibase.user=abc liquibase.password=xyz liquibase.url=jdbc:postgresql://something.eu-west-1.rds.amazonaws.com:5432/app?ApplicationName=${appName}-liquibase liquibase.enabled=true liquibase.contexts=dev,postgres We have at this moment 3 different microservices in deployment and we noticed that for

Is Auto_Increment supported in Oracle using Liquibase

≯℡__Kan透↙ 提交于 2021-02-10 14:30:02
问题 I want to add an auto_increment column in an oracle database using liquibase script. I have tried using the auto_increment attribute in liquibase : <column name="SUPPLEMENT_ID" type="INTEGER" autoIncrement="true" > <constraints primaryKey="true"></constraints> </column> If oracle supports auto_increment, how can I achieve it using liquibase scripts? 回答1: IDENTITY columns are introduced in oracle 12c which allows users to create auto increment columns But if you are using older versions you

Is Auto_Increment supported in Oracle using Liquibase

梦想的初衷 提交于 2021-02-10 14:28:39
问题 I want to add an auto_increment column in an oracle database using liquibase script. I have tried using the auto_increment attribute in liquibase : <column name="SUPPLEMENT_ID" type="INTEGER" autoIncrement="true" > <constraints primaryKey="true"></constraints> </column> If oracle supports auto_increment, how can I achieve it using liquibase scripts? 回答1: IDENTITY columns are introduced in oracle 12c which allows users to create auto increment columns But if you are using older versions you

Liquibase migration on startup doesnt work using Spring-Boot

半城伤御伤魂 提交于 2021-02-08 20:00:08
问题 Following this documentation: To automatically run Liquibase database migrations on startup, add the org.liquibase:liquibase-core to your classpath. The master change log is by default read from db/changelog/db.changelog-master.yaml but can be set using liquibase.change-log. In addition to YAML, Liquibase also supports JSON, XML, and SQL change log formats. I configured my application to use liquibase migrations. I added liquibase.change-log property so my whole application.properties file

Force Liquibase to map Blob to BYTEA on PostgreSQL

China☆狼群 提交于 2021-02-07 13:14:01
问题 How to tell Liquibase to map BLOB datatype to BYTEA on PostgreSQL? It seems that Hibernate people has taken over and adapted the tool to their needs: https://liquibase.jira.com/browse/CORE-1863 , however, EclipseLink don't support oid's and the bug seems to be still open: https://bugs.eclipse.org/bugs/show_bug.cgi?id=337467 I need to use EclipseLink, and I need to use blobs with PostgreSQL. I'd like to use Liquibase, is it possible to make those things work together? 回答1: You have two options

Force Liquibase to map Blob to BYTEA on PostgreSQL

自作多情 提交于 2021-02-07 13:13:59
问题 How to tell Liquibase to map BLOB datatype to BYTEA on PostgreSQL? It seems that Hibernate people has taken over and adapted the tool to their needs: https://liquibase.jira.com/browse/CORE-1863 , however, EclipseLink don't support oid's and the bug seems to be still open: https://bugs.eclipse.org/bugs/show_bug.cgi?id=337467 I need to use EclipseLink, and I need to use blobs with PostgreSQL. I'd like to use Liquibase, is it possible to make those things work together? 回答1: You have two options