liquibase - Move data between tables

I'm currently using Liquibase in a small project of mine, which works pretty fine.But right now i'm facing a problem. My ChangeLog works as expected in my testenv but fails on my productiv one. This happens because my prod-tables contain a few rows of data. I know there is an UPDATE-Command in liquibase, but im not sure how to use it correctly. What i want to archive is to move a column from table B to table A without losing its data. Table B contains a foreignkey of table A. A normal SQL-Statement would look smth like update A set A.x = (selec...Read more

apache karaf - Liquibase cannot find File in an OSGI Bundle

I am building an OSGI Bundle with the apache bundle plugin and deploy it on a Karaf Instance.I have implemented Liquibase in my Bundle Activator in the following way:String Config = bundleContext.getBundle().getResource("com/test/db.changelog-master.xml").getPath();Liquibase liquibase = new Liquibase(Config, new ClassLoaderResourceAccessor(), database);I now get the following exception: liquibase.exception.ChangeLogParseException: /com/test/db.changelog-master.xml does not existYet the Resource apparently does exist as bundle.getResource return...Read more

Liquibase checksum value prefix

I want to create a changeset with a validChecksum field, so I looked into the DATABASECHANGELOG table and noticed the entries have a prefix.E.g.: 1:7ad9f8d1a1b4abc71f2eab8131d456bHow much of that should be used as input? The actual checksum is only what follows after the colon, but will it still work without the prefix 1: ?...Read more

liquibase - Smaller Changesets when Generating Changelogs

Is it possible to generate change logs, merging change sets together?Like this:<changeSet author="Author" id="1"> <dropNotNullConstraint columnDataType="varchar(255)" columnName="name" tableName="table"/> <dropNotNullConstraint columnDataType="varchar(255)" columnName="phone" tableName="table"/> <dropNotNullConstraint columnDataType="bigint" columnName="email" tableName="table"/></changeSet>instead of this:<changeSet author="Author" id="1"> <dropNotNullConstraint columnDataType="varchar(255)" c...Read more

how to use liquibase diffChangeLog with the current changelog as reference (to generate incremental change set)

I have an existing database and have used the generateChangeLog command line to create the initial changelog. This works fine :-)But now I want the developers to use all the tools/processes they know/use already to develop the database and code and use a script to generate any incremental change sets as appropriate.That is: do a diff against the current state of the developer's database (url/username/password in the properties file) using the current changelog (changeLogFile in the properties file) as the base reference.There seems no easy way ...Read more

Start again from latest schema with liquibase

I am using liquibase 3.2.0 on ORCID, and finding it really useful.We now have over 200 changeSets on top of the original schema.These run many times during unit tests because we are using an in memory database (hsqldb).I would like to 'reset' liquibase by making a new install.xml from the current schema, so that we do not have to run all the changeSets every time.However, the production database (postgres) has a databasechangelog table with all the old changeSets, so it will try to apply the new install.xml.How can I start again from a new inst...Read more

liquibase - Migrate LiquibaseChangeLog entries

We're using Liquibase to handle our DB Schema changes. As we already have quite a large set of ChangeLogs distributed over multiple files, arranged in a complex folder structure, there sometimes rises the need or the desire to make some refactorings that would influence the meta information in the DatabaseChangeLog table.What is the recommendation for such refactorings? Can I use Liquibase itself to update the DatabaseChangeLog entries or will I run into caching issues?A simple example to make my case clearer:I have created a new changeLog file...Read more

liquibase - updateSQL command precedes databasechangelog table with current schema name

When I execute the sqloutput command, liquibase 3.2.2 precedes each insert on databasechangelog table with current schema name.INSERT INTO <MY_TEST_SCHEMA>.DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, LIQUIBASE) VALUES (...);This forces me to process the outcome files to remove the "MY_TEST_SCHEMA." string, because we execute liquibase against a test schema before we launch the resulting files to production.I've been using liquibase 2.0.3 for quite long and this behaviour i...Read more

Erroneous md5sum failure for liquibase changeSets

We are using liquibase 1.9.5, but I haven't seen this as a known bug for that version. The short story is we successfully ran liquibase for our 1.0 release, but it errors out complaining about the md5sums of the 1.0 changeSets when trying to run our 1.1 release that has additional changeSets.We've worked around it in the short term by just nulling out the md5sum column in DATABASECHANGELOG, but I'm wondering if I'm just doing something wrong.We organize our liquibase as follows:One master .xml file that we run on every deployment, which just h...Read more

Liquibase Code generated for a conditional index gives error in MS SQL Server

I have this following index in my SQL Server DatabaseCREATE NONCLUSTERED INDEX XCR_ACTIVE ON dbo.CS_PA_VEH_BASE ( ETL_ACTIVE_FL ) WHERE ETL_ACTIVE_FL = 'N' ON "default";for which liquibase gives out following: <createIndex indexName="XCR_ACTIVE" tableName="CS_PA_VEH_DELTA"> <column computed="true" name="([ETL_ACTIVE_FL]='N')"/> </createIndex>But when I want to execute it (also in MS SQL Server) I get the following > **Error:** (14.2) 05-24-19 11:43:05 (E) (13004:15088) RUN-050304: |Session JOB_ODS_Liquibase Fun...Read more

cannot find database driver oracle.jdbc.oracledriver while running liquibase in cmd

/i am trying to execute normal liquibase command for changelog in commandprompt but it is saying driver not exist/liquibase --driver=oracle.jdbc.driver.OracleDriver --classpath=C:\oraclexe\app\oracle\product\11.2.0\server\jdbc\lib\ojdbc6.jar --changeLogFile=db.changelog-1.0.xml --url="jdbc:oracle:thin:@localhost:1521:xe" --username=system --password=root update/please any one tell me why throwing oracle.jdbc.driver.OracleDriver not found/...Read more