FAQ Database Discussion Community


Can you clear liquibase checksums for a given file only?

liquibase
Running liquibase --url=jdbc:oracle:thin:@localhost:1521/XE -- driver=oracle.jdbc.OracleDriver --changeLogFile=db.changelog-next.xml -- username=owner --password=xxxx --logLevel=info clearCheckSums clears ALL checksums from the database. Is there a way to clear only the checksums for changesets in db.changelog-next.xml. Thanks...

Is there a liquibase lock timeout?

timeout,locking,liquibase,lock-timeout
You can see in the issue here: (liquibase-lock-reasons) at situation where the client Liquibase locks when a Liquibase operation has been interrupted, leaving liquibase in a locked state. I'm wondering if there is a way to configure Liquibase to automatically detect this situation from the date and time in the...

How does Liquibase Tag - commandline

liquibase
I was able to tag successfully using liquibase commandline, but do not know where it is tagged to and stored. The command was executed successfully, below is the input and response to the tag command. This may be a very trivial question, but i could not find any documentation to...

Update query in liquibase

oracle,liquibase
I need to run the below update query in liquibase, but I am not sure about the syntax. Can anyone please help: update xyz.users set email = (select CONCAT(username, '@gmail.com ') "email" from xyz.users ) where email like '%@yahoo.com%' ; ...

multiples dbms in precondition of liquibase using yaml

yaml,liquibase,preconditions
In precondition documentation of liquibase we can see the example below: <preConditions> <dbms type="oracle" /> <dbms type="mysql" /> </preConditions> When try to recreate the same rule using yaml, it not works. preConditions: dbms: type: oracle dbms: type: mysql I also have tried something like: preConditions: - dbms: dbms: type: oracle...

Liquibase: how to run always a changeset as the last update operation

liquibase
I'm using Liquibase on my project and need always to execute a procedure after each Liquibase updates... Currently, the changeSet looks like this: <changeSet id="liquibase-0" author="liquibase" runAlways="true"> <sqlFile relativeToChangelogFile="true" path="procedure/owner-changer.sql"/> </changeSet> How can I do ensure that this changeSet will be run as the last update operation? Thks...

Why my predcondition is not serialized?

java,spring,liquibase
I have a problem. I autogenerate my changelog. I try to add some precondition on a changeset. But when i serialize mys changeset, the precondition rule doesn't appear in my XML changelog. I see only the addcolumn section Here how i generate my changeset: final ChangeSet changeset = new CustomChangeSet("myId",...

liquibase database build from scratch

mysql,liquibase
When I run liquibase update from scratch, it takes a while as the process fires each changelog one by one. Sometimes my own database changes diverge enough that its easiest to rebuild the database if I want to start again for example. The rebuild would be quickest if I did...

Can Liquibase use DB2's multiple tablespaces?

db2,liquibase,db2-luw
In DB2 LUW it is recommended that tables, indexes and "long objects" (ie LOBs) should be placed in separate tablespaces. Our existing SQL scripts have lines like this: CREATE TABLE "APPLICATIONTABLE"( APPLICATIONID INTEGER NOT NULL, APPLICATIONNAME VARCHAR(30) NOT NULL )IN USERSPACE1 INDEX IN USERSPACE2 LONG IN USERSPACE3; In a changeset...

How to improve performance of Liquibase on Greenplum database

postgresql,liquibase,greenplum
I'm evaluating the use of Liquibase (3.3.2) against a Greenplum (Postgres on steroids) database using postgresql 8.4-701.jdbc4 and am running into performance issues when trying to add one changeset (create table) against an existing schema containing many partitioned tables. I'm in hour three currently, with no idea how much longer...

Liquibase NoSuchMethodError with SQL Server

sql-server,liquibase
When running my Liquibase setup I'm getting the following error: Caused by: java.lang.NoSuchMethodError: liquibase.database.Database.escapeTableName(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; I really cannot tell what is wrong with my initial schema file, can anyone with more experience help me spot the errors? If I had to guess it's most likely something from the file I have...

MS SQLServer JDBCcommandline with Liquibase - Login Failure/ TCP IP Exception/ Port Not Valid

sql,sql-server,sql-server-2008,liquibase,mssql-jdbc
I'm trying to connect to Microsoft SQL Server 2008 SP3 using Liquibase and Microsoft JDBC Driver 4.1. I get various exceptions and not a single successful way to authenticate into the server via commandline. With the same username and password I was able to login to the database via MS...

liquibase generate sql between 2 changelogs

java,mysql,liquibase
We currently use liquibase to version control our mysql database, however, we are not allowed to run liquibase on production. The first time we deployed we did an sql dump of the database, which was the amalgamation of all the changelogs to date. So say the changelog currently is at...

jhipster run embedded jar with prod profile - issue with liquibase

liquibase,jhipster
I have packaged my app with : mvn -Pprod package Then I ran java -jar myapp-0.0.1-SNAPSHOT.war it works fine. But if I run : java -jar myapp-0.0.1-SNAPSHOT.war --spring.profiles.active=prod I am getting this error: [ERROR] org.springframework.boot.context.embedded.tomcat.ServletContextInitializerLifecycleListener - Error starting Tomcat context: org.springframework.beans.factory.BeanCreationException [WARN] org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context...

Liquibase generateChangeLog command - generating changelog with insert statements

oracle,db2,liquibase,dml
To generate insert statements from my databases (oracle,db2) i've used liquibase generateChangeLog command with argument --diffTypes="data" This command generate correct xml with insert statements, however this is not aware of foreign constraints, so I cannot use this file to again to fill my databases. Similar problems has been described here...

Maven liquibase plugin

maven,pom.xml,liquibase
I am new to Maven and Liquibase. For the past couple of days, I have been playing around with liquibase without Maven. I have tried generating changelog file with a new database and an existing database. Now I am trying to implement Maven and Liquibase using the plugin. What is...

Liquibase not working from within JBoss?

liquibase
I am using Liquibase 3.3.2 and trying to implement a webservice that accepts a number of changelogs, looks up a specific DataSource depending on the context, and use that DataSource together with the liquibase ChangeLogs to perform a database update. I am using PostgreSQL as a database. Somehow the liquibase...

Create column of type double precision[] with liquibase

postgresql,liquibase
How to create column of type double precision[] (array of doubles) with liquibase in postgresql database? <changeSet id="add t_name table"> <createTable tableName="t_name"> ... <column name="doubleArray" type="???"/> ... </createTable> </changeSet> Google didn't help, please, if someone knows a solution, I will be very appreciative....

loadUpdateData in liquibase, select only some columns from csv

mysql,liquibase
Assume having the following csv: a,b,c 1,2,3 where a,b,c are column names and 1,2,3 are values. Is it possible to load only columns a,b? <loadUpdateData tableName="TABLE" file="file.csv" primaryKey="a"> <column name="a" header="a"/> <column name="b" header="b"/> </loadUpdateData> This will generate an SQL error, because it will try to insert column c. I...

Liquibase endDelimiter usage

oracle,plsql,liquibase
Trying to run this from Liquibase: --changeset blah runOnChange:true endDelimiter:\n/\s*\n|\n/\s*$ DELETE MYTABLE; INSERT INTO MYTABLE(A,B,C) VALUES ('A', 'B', 'C'); DECLARE row_count NUMBER; BEGIN SELECT COUNT(1) INTO row_count FROM OTHERTABLE; IF (row_count = 0) THEN DELETE MYTABLE WHERE A LIKE 'BLAH:%'; END IF; END; / But getting this error: Caused by:...

ERROR: cannot ALTER TABLE because it has pending trigger events while attempting to drop a column in a table

sql,postgresql,liquibase
I wrote a sql tag in my liquibase changeset. this sql code is suppose to make data migration in a table named "Purchase". so i have the following sql queries: UPDATE purchase SET location_id = (SELECT location_id FROM shop WHERE shop.id = purchase.shop_id); then, ALTER TABLE purchase DROP COLUMN shop_id;...

How to execute liquibase with java.lang.NumberFormatException on PostgreSQL

java,postgresql,powershell,liquibase
In trying to execute diffChangelog in liquibase 3.3.3 on a PostgreSQL 9.3 database (from PowerShell script) as: $_cmd='C:\liquibase-3.3.3-bin\liquibase --driver=org.postgresql.Driver --url=jdbc:postgresql://localhost:5432/chaos --username=postgres --password=Password diffChangelog --referenceUrl=jdbc:postgresql://xxx.xxx.xxx.xxx:5432/chaos --referenceUsername=postgres --referencePassword=Password > db-changelog.xml'; CMD.EXE /c "`"$_cmd`"" I get the error: *CMD.EXE : Unexpected error running Liquibase:...

How to update already run database migration files using Grails DBMigration plugin?

grails,database-migration,liquibase
I have migration file named test-plugin-migration-1.2.groovy which nedds to be only renamed as migrations listed in it are already run and some other custom migrations. test-plugin-migration-1.2.groovy - > test-plugin-migration-1-2.groovy I tried adding a custom migration for DATABASECHANGELOG table in new file named rename-migration.groovy rename-migration.groovy changeSet(author: "Laxmi Salunkhe", id: "12345-1") {...

How to enforce column order with Liquibase?

postgresql,liquibase
Setup: liquibase 3.3.5 PostgreSQL 9.3 Windows 7 Ultimate Having set the Liquibase.properties file with changeLogFile = C://temp/changeset.xml, I created a diff file with Liquibase (3.3.5). liquibase.bat diffChangeLog Examination of the changeset.xml file shows -<addColumn tableName="view_dx"> <column type="int8" name="counter" defaultValueNumeric="0" defaultValue="0"/> </addColumn Problem is when liquibase.bat update is run, the changed...

Get the output SQL from a Liquibase changeset

java,spring,spring-boot,liquibase
I'm having a SQL syntax error when my Spring Boot application tries to start. It cannot instantiate the SpringLiquibase bean, because the outputed SQL of a changeset is leading to a syntax error. I need to check the SQL generated from Liquibase in order to find what's wrong. How can...

How can I force Liquibase to recalculate checksums without re-running the statements?

checksum,liquibase
We're using Liquibase 3.2 with Java 6. Is there a way I can force Liquibase to recalculate checksums without re-running the same statements from our Liquibase files? In our database, I run this ... update DATABASECHANGELOG set md5sum = null where 1; However, when I run my Liquibase change scripts,...

Why are all contexts executed when non specified on update?

liquibase
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 example: changeset A: context=test changeset B: no context changeset...

How to insert using a sequence with Liquibase

hsqldb,liquibase
I would like to do a liquibase insert with the primary key being auto generated from the sequence defined in the database. The target database is HSQLDB. It works to do an insert specifying a value for the primary key <insert ...> <column name="TAG_ID" valueNumeric="2"/> I found this (admittedly older)...

Liquibase 3.3.3 refusing to run “due to maven configuration”

maven,liquibase
Did something change in liquibase between version 2 and version 3? I have the following in my pom file... <plugin> <groupId>org.liquibase</groupId> <artifactId>liquibase-maven-plugin</artifactId> <version>3.3.3</version> <configuration> <changeLogFile>src/main/resources/liquibase/liquibase-changesets.xml</changeLogFile> <driver>${db.liquibase.driver}</driver> <username>${db.liquibase.username}</username>...

How do I use a Liquibase changelog which is in jar file

java,spring,maven,spring-boot,liquibase
I currently have the following in my application.properties: liquibase.change-log=classpath:/db/changelog/db.changelog-master.xml The actual path to the file is src/main/resources/db/changelog/db.changelog-master.xml. The changelog is found by Liquibase and everything is working as I would expect. I've moved the changelog and all of the project's JPA entities and repositories into a separate project so that...

Liquibase not dropping sequences on Postgres

postgresql,maven,sequence,liquibase
i'm driving crazy already as liquibase (on postgres) is not dropping sequences when running a liquibase:dropAll through the maven plugin. These sequences are created by liquibase itself through different changelogs. I've found that there was the same issue once for Derby but that is resolved already. Is anyone aware of...