Questions tagged [liquibase]
Liquibase is an open source, database-independent library for tracking, managing and applying database changes. It is built on a simple premise: All database changes are stored in a human readable yet trackable form and checked into source control.
3,568
questions
0
votes
1
answer
81
views
export Oracle DB schema in H2 format with liquibase. Difference between `sql` and `xml` outputs
I'm exporting a Oracle schema, and I want to have a script that I can use for in-memory tests with H2.
I export the schema with maven, mvn liquibase:generateChangeLog.
I have noticed that when I ...
0
votes
0
answers
44
views
Vendor-independent SQL syntax for dropping unique and primary key constraints
Precondition:
I am using Liquibase with SQL scripts in my app. I started testing with Oracle DB, but now I need to switch to PostgreSQL DB.
Problem:
When I added constraints, I didn't add the names of ...
1
vote
2
answers
77
views
liquibase :: is it possible to remove <validCheckSum> tags programmatically
In Liquibase, the incrementby attribute in addautoincrement tag throws validation error in 4.16.1 version. I had to remove the incrementby attribute, which changed the md5sum.
To tackle that I had ...
1
vote
0
answers
105
views
Validation failure when upgrading Keycloak from 19.0.1 to 19.0.2/3
I am trying to upgrade my Keycloak docker image version from 19.0.1 to 19.0.2 or 19.0.3 and I get a checksum validation error:
auth | 2022-10-31 03:31:50,864 INFO [io.quarkus....
0
votes
1
answer
38
views
obtain the ";" in liquibase output sql when using mssql
Is there any way to control the output of the Liquibase command updateSql when running on Microsoft SQL Server, so that the resulting SQL text is terminated with the ; instead of the GO, similarly to ...
0
votes
0
answers
46
views
Load Liquibase files in Oracle xe Test Container from different module in spring boot project
I need to write DataJpaTest for the repository tests using the oracle test container. Using
spring.liquibase.change-log=classpath:/liquibase/liquibaseChangeLog.xml
but Liquibase file exists in a ...
0
votes
0
answers
19
views
Referring to previous changesets in the Liquibase changelog
I have a Liquibase changelog that contains a linear set of changesets, in XML format, with nothing fancy happening (i.e., no contexts, labels, etc.). This is run against AWS Redshift, but I don't ...
0
votes
0
answers
28
views
How to use Timestamp with Liquibase + Mongodb insert object(org.bson.json.JsonParseException: JSON reader expected a type name but found 'Timestamp')
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/...
0
votes
1
answer
94
views
Run Liquibase without license warning using Community Edition
We use Community Edition of Liquibase in our project. When running Liquibase via gradle tasks we see this warning:
WARNING: License service not loaded, cannot determine Liquibase Pro license status...
...
1
vote
1
answer
45
views
Optimistic Lock @Version not working in Unit Test
in my application Java - Spring Boot - Hibernate - Liquibase
On normal run checking version work correctly, and i get expected error during update with wrong version parameter.
But on Junit test ...
0
votes
0
answers
337
views
database schema creation with the use of liquibase at spring does not work
in spring boot version below 2.5.0 I had this configuration in application.properties:
spring.datasource.initialization-mode=always
spring.datasource.url=jdbc:postgresql://localhost:5432/mydb?...
0
votes
0
answers
44
views
How to use a composite key as a foreign key? (ERROR: insert or update on table violates foreign key constraint...)
I'm having a hard time trying to figure out what's the correct way to use a composite key as a foreign key. Say we have a Country that has many Citys that have many Districts. The composite key on ...
0
votes
1
answer
324
views
Liquibase Unknown change type 'loadData'
I have been using JHipster for a long time.
But suddenly, I faced this stupid exception, and I couldn't find any solution for it.
I have exactly one other project that works without any problem, but ...
1
vote
1
answer
77
views
Liquibase Docker Redshift Connection Error
When attempting to connect to Redshift from the latest liquibase/liquibase Docker image v4.17.0, Liquibase returns an error:
Unexpected error running Liquibase: Driver class was not specified and ...
0
votes
0
answers
83
views
Liquibase-Github actions (Connection timed out error while running liquibase in github actions and while doing diff generation)
When I'm trying to run Liquibase in Github actions workflows getting the below error
Unexpected error running Liquibase: Connection could not be created to jdbc:mariadb://10.13.10.2:3306/...
1
vote
1
answer
84
views
Adding 1 day from the current date in liquibase property
I need to insert a date by adding 1 day to the current date using Liquibase.
I'm using Liquibase property for this. But it is always inserting the current date.
Following is the property I'm using
<...
0
votes
0
answers
81
views
Liquibase with column type numeric(x, y) is creating postgreSQL table with column type number
I have a spring application connected to a postgreSQL DB. My issue is that this bit of script:
<column name="utmx" type="numeric(20, 5)">
<constraints nullable="...
0
votes
0
answers
32
views
A double sequence is generated in the Spring Boot app
I'm developing a Spring Boot application and I'm having a problem with sequence generation.
For migrations I use liquibase.
I create a sequence in liquibase.
CREATE SEQUENCE public....
0
votes
0
answers
56
views
Whare the sequence values cached in Hibernate when setting the allocationsize of the sequencegenerator more than 1 and how to clear it's cached values
I had a performance issue in a spring boot application and one step to improve it, is to apply the patch update/insert and to apply it, I had to change the generator strategy of the ID to sequence ...
0
votes
2
answers
189
views
How we can update table A column by table B column value using liquibase yml script
I want to update table A's name column with Table B's name column value where table B's id is present in table A.
I am trying this using the liquibase yml script but its not working.
databaseChangeLog:...
0
votes
0
answers
54
views
incrementBy not working, Set auto_increment_offset as global variable for mariadb liquibase
Following syntax is giving validation error when we run liquibase migration.
<addAutoIncrement columnDataType="int"
columnName="intColumn"
...
6
votes
0
answers
100
views
“Time(3)” type on Liquibase with MySQL 8
I'm facing a problem using Liquibase with MySQL 8 where the following script is not putting the fraction part of type "time(3)", it only puts "time" on the type of the column. We ...
1
vote
1
answer
55
views
Using liquibase how can I add a ngram index to an existing table?
A mysql database has existing tables maintained with liquibase. There is a need now to search using a ngram enabled fuzzy search. How can I specify in my changeset to use the ngram parser or fuzzy ...
2
votes
1
answer
828
views
SpringBoot+Liquibase+TestContainer db - not able to populate db during integration test
I am trying to use TestContainers for my integration tests. What I am trying to do is use sql script to populate with some data, and then also add new data using tests. Below is the test setup:
...
0
votes
1
answer
62
views
Liquibase update when pod goes down
I am deploying liquibase scripts using CI CD pipeline. There are some instances where a liquibase changeset transaction might take very long and the pod may go down during that time. For example, a ...
0
votes
1
answer
62
views
liquibase-maven-plugin generate changelog ERROR
cannot generate changelog from an exist db,errors return like below:
Invalid string encoding on createTable.remarks. To resolve, remove the invalid character on the database and try again in changeSet
...
1
vote
1
answer
71
views
Getting error Liquibase validation failed because checkum has changed in GITHUB Actions
I am getting the error Liquibase checksum validation failed.
Error
Unexpected error running Liquibase: Validation Failed:
1 change sets check sum
changelog.sql::3::snowflake was: 8:...
0
votes
0
answers
74
views
Liquibase classcastException with mongodb
Getting this exception :
class liquibase.database.core.UnsupportedDatabase cannot be cast to class liquibase.nosql.database.AbstractNoSqlDatabase (liquibase.database.core.UnsupportedDatabase and ...
0
votes
0
answers
41
views
How can I get past this major issue with Liquibase changesets within a Grails upgrade?
I'm hoping to find someone who may have already been through the pains I'm encountering due to the Liquibase and Hibernate version updates causing major behavioral differences that can share their ...
2
votes
1
answer
158
views
Spring, H2, R2DBC and Liquibase: /.testdb.trace.db: Read-only file system
When trying to start a Spring Boot application for tests (with H2 database) with R2DBC and Liquibase configured, I get the following error:
2022-10-04 12:50:18.893 INFO 57774 --- [ main] .s....
0
votes
0
answers
108
views
How do I define a check constraint on a column using liquibase? [duplicate]
I'm using Liquibase to build a Postgres SQL table. I have a column I'd like to add a check constraint to in order to ensure that the values in this column are in my set of acceptable values. I've ...
0
votes
0
answers
43
views
Database agnostic views with liquibase
I am facing a problem related to the creation of views across multiple RDBMS.
I started from a db in SQLite with a view like this:
create view V001 (viewfield1, viewfield2) as
select field1, strftime(...
0
votes
0
answers
106
views
Liquibase can not find file containing H2 bin
When trying to generate a liquibase diff I get the following:
Starting Liquibase at 00:18:57 (version 4.1.1 #10 built at 2020-10-12 19:24+0000)
Unexpected error running Liquibase: '/usr/local/apps/h2/...
0
votes
0
answers
43
views
R2DBC Bad Grammar Exception
I'm getting a bad grammar exception when using R2DBC but I can't figure out what is causing it.
Liquibase
databaseChangeLog:
- property:
name: uuid_type
value: uuid
dbms: ...
0
votes
1
answer
211
views
How to set tag to changeset in SQL format to run rollbackTag Liquibase Maven?
I want to set tag to my changeset to rollback to this changeset again if I need.
So I wondered about how to set tag to changeset in SQL format.
Thanks in advance.
Here is my databasechangelog table on ...
0
votes
0
answers
64
views
Migration creates duplicate column
My changeset in XML worked in version 4.6.1 :
<changeSet author="tts" id="3-2">
<addColumn schemaName="" tableName="ITEMS">
<...
0
votes
1
answer
112
views
@Column settings in case of externally managed database schema
When externally managing the database schema (e.g. with Liquibase), in addition to specifying the Liquibase changesets, you have to help Hibernate understand your data structure using JPA annotations.
...
0
votes
1
answer
108
views
Create all Entity Class Tables automatically on each new X-TenantID in Multi-Tenancy
We are developing an application with separate schema based multi tenancy with PostgreSQL and Spring Boot. I am sending the X-TenantID header in each server request as a Schema name. However, I am ...
0
votes
1
answer
95
views
Is it possible to generate changelog diffs?
I've got my baseline snapshot created using the generateChangeLog command. I've made some changes and I'm trying to figure out how to generate a changeset file by doing some sort of diff but it seems ...
0
votes
2
answers
59
views
Liquibase equivalent of beforeEachMigrate in Flyway
I am trying to find the Flyway's beforeEachMigrate equivalent functionality in liquibase. Does liquibase have a way to execute an SQL script before each new migration script is executed?
My current ...
0
votes
1
answer
148
views
Liquibase failed to start because no changelog could be found at:
I have a basic Rest program in which I'm using Liquibase. Was about to run it and this appears on the run:
Not pretty sure on what to do to solve it
0
votes
0
answers
55
views
Does anyone know of a workaround for incompatibilities between Liquibase and Hibernate Envers within a Grails project?
Attempting to call dbmGormDiff in a Grails 5 project using the Database Migration plugin and Hibernate Envers fails with
Command execution error: EnversService#initialize should be called only once
...
0
votes
0
answers
139
views
Is there a way to dynamically partition a PostgresSQL table for each month?
I have a large table that I need to partition based on a date field and the partitions will each be one month. Like so:
create table my_schema.my_table_202210 partition of my_schema.my_table
for ...
1
vote
1
answer
66
views
Prevent Liquibase migrating public schema in Postgres and only migrate configured schemas
I'm using org.postgresql:postgresql:42.1.4 with an instance of the official Postgres Docker image running via docker-compose.
The database has the public schema by default, and I manually create ...
0
votes
1
answer
30
views
Using liquibases init project from gradle plugin
Liquibase has init project subcommand to get started with Liquibase.
Is it possible to run this command via the Liquibase Gradle Plugin?
If not, is it possible to generate a skeleton / empty ...
1
vote
0
answers
55
views
Run jOOQ <-> Liquibase in silent mode
I have set jOOQ configuration with Liquibase database, all is working good. I want to execute gradle generateJooq task in silent mode, but there are some other logs got from liquibase for anyway for ...
0
votes
1
answer
88
views
Liquibase boolean for Oracle and HSQLDB
I need to insert a new row inside both Oracle (for prod) and HSQLDB (for tests) with only one <insert>, but the boolean is what makes the problem - Oracle expects 1, HSQLDB expects true.
Here is ...
0
votes
0
answers
55
views
node-liquibase is outputting the DB connection details in the console. How to stop it?
const myConfig = {
...POSTGRESQL_DEFAULT_CONFIG,
changeLogFile: './changelog.xml',
url: `jdbc:postgresql://${AppConfigs.Database.host}:${parseInt(AppConfigs.Database.port, 10)}/${...
0
votes
0
answers
99
views
Define multiple liquibase datasources in Quarkus YAML
How can I define multiple datasources for the Quarkus YAML extension ?
Apperantly, it works like the following in the application.properties file:
# Liquibase configuration for the default datasource
...
0
votes
0
answers
16
views
From inside a Gradle dependency apply plugin to parent project
application is a Gradle based project made up of a collection of separate projects, each project published independently and individually added as dependencies based on application requirements:
.
└── ...