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.

Liquibase Supports:

  • Extensibility
  • Merging changes from multiple developers
  • Code branches
  • Multiple Databases
  • Managing production data as well as various test datasets
  • Cluster-safe database upgrades
  • Automated updates or generation of SQL scripts that can be approved and applied by a DBA
  • Update rollbacks
  • Database ”diff“s
  • Generating starting change logs from existing databases
  • Generating database change documentation

Resources

3764 questions
24
votes
1 answer

Define Changeset for insert query in liquibase

I have two table as following : CREATE TABLE StudentMaster ( sId SERIAL, StudentName VARCHAR(50) ); CREATE TABLE StudentClassMap ( studnetId BIGINT UNSIGNED NOT NULL, studentClass VARCHAR(10), FOREIGN KEY (studnetId) REFERENCES…
unknown
  • 4,859
  • 10
  • 44
  • 62
23
votes
3 answers

Using Liquibase to initialize in-memory H2 for unit tests in Spring Boot application

I've used in-mem databases in Spring JPA tests many times, and never had a problem. This time, I have a bit more complex schema to initialize, and that schema must have a custom name (some of the entities in our domain model are tied to a specific…
cvnew
  • 570
  • 1
  • 7
  • 13
23
votes
5 answers

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

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.
Tatiana Totskaya
  • 233
  • 1
  • 2
  • 5
23
votes
4 answers

Alter column length with liquibase

I am having problems changing a column length in my postgres db with liquibase. I have a table account with a field description varchar(300). I want to change it to varchar(2000). I have dropped and recreated the primary key in the same file so I…
gringogordo
  • 1,990
  • 6
  • 24
  • 60
22
votes
3 answers

Adding a non-nullable column to existing table fails. Is the "value" attribute being ignored?

Background: we have a Grails 1.3.7 app and are using Liquibase to manage our database migrations. I am trying to add a new column to an existing table which is not empty. My changeset looks like this: changeSet(author: "someCoolGuy (generated)",…
David
  • 1,940
  • 3
  • 17
  • 30
22
votes
5 answers

How to manage schema migrations in Google BigQuery

How to manage schema migrations for Google BigQuery, we have used Liquibase and Flyway in the past. What kind of tools can we use to manage schema modifications and the like (e.g. adding a new column) across dev/staging environments.
22
votes
2 answers

Liquibase Stored Proc's management

I read liquibase's best practices, specifically for managing stored procedures: Managing Stored Procedures: Try to maintain separate changelog for Stored Procedures and use runOnChange=”true”. This flag forces LiquiBase to check if the changeset…
Dave
  • 1,645
  • 2
  • 23
  • 39
22
votes
1 answer

altering my sql table to add multiple new columns at once using liquibase

What is the correct syntax to alter the table and adding multiple columns at a time using liquibase xml. The official document gives the example for adding only one column :
smart987
  • 834
  • 2
  • 14
  • 34
22
votes
3 answers

Convert Liquibase XML to YAML?

Can I automatically convert Liquibase changelog files in the XML format to the YAML format?
user3364825
  • 1,541
  • 1
  • 15
  • 23
21
votes
5 answers

How to solve liquibase waiting for changelog lock problem in several pods in OpenShift cluster?

We are supporting several microservices written in Java using Spring Boot and deployed in OpenShift. Some microservices communicate with databases. We often run a single microservice in multiple pods in a single deployment. When each microservice…
Alex Crazy
  • 232
  • 1
  • 2
  • 12
21
votes
4 answers

How to create schema in Postgres DB, before liquibase start to work?

I have standalone application. It’s on java, spring-boot, postgres and it has liquibase. I need to deploy my app and liquibase should create all tables, etc. But it should do it into custom schema not in public. All service tables of liquibase…
G.O.
  • 470
  • 1
  • 3
  • 16
21
votes
3 answers

Cant run liquibase with command line

I want to use liquibase but when I want to let it run with command line this happens: PS C:\Users\Ferid\Downloads\liquibase-3.6.0-bin> .\liquibase Error: A JNI error has occurred, please check your installation and try again Exception in thread…
Mad Scientist
  • 857
  • 4
  • 16
  • 43
21
votes
2 answers

java - illegalStateException: Cannot find changelog location: class path resource (liquibase)

I am getting this error when I try to run my spring boot application. I am new to java and spring development. Please let me know if you require more info. I'm not sure what it means by "cannot find changelog location ..." 2017-02-01 16:19:22.543…
Riyaz Shaikh
  • 225
  • 1
  • 2
  • 10
21
votes
5 answers

Why are all contexts executed when non specified on update?

I'm using Liquibase 3.3.5 to update my database. Having contexts is a nice way to only execute specific parts of the changelog. But I don't understand, why ALL changesets are executed, when no context is provided on update. Consider the following…
javg
  • 405
  • 1
  • 5
  • 10
20
votes
3 answers

How to create liquibase changeset for integration tests in springboot?

I want mock data for integration tests by liquibase changeset, how to make that to not affect real database? I found partial idea from here, but I am using springboot and I hope there is simpler solution.
Bartek
  • 2,109
  • 6
  • 29
  • 40