Quantcast
Channel: Liquibase Forums
Viewing all 2993 articles
Browse latest View live

Re : Upgrade 3.1.1 to 3.2.0 throws liquibase.exception.ValidationFailedException: Validation Failed: 1 change sets check sum .. is now: ..

$
0
0
Since Zoho does not allow multiple attachments, I attach the stacktrace here.

Re : Checksum changed without reason

Liquibase Mysql Includes

$
0
0
I've branched at https://github.com/carljoans/liquibase
These are special considerations for MySQL which include the following:
-- Fulltext Index for columns
-- SQL escape. Escaping single quotes when generating csv data dump.
-- Table Engine. MyISAM, InnoDB, etc. added to changlelog
-- Column Datatype replicated exactly as created. ( i.e. int only went up to int(10) even though the column was created as int(11), double created as double(22) which generates an sql error, etc. )

Then there are some general changes that I just thought would be helpful to my specific projects:
-- only create csv during data dump if there is data in table, instead of generating a csv for an empty table.
-- Creating multiple changelog files at once
-- Including or Excluding only certain tables in data or creation dump. Say if you want to export only specific tables. As per the previous point, you can put certain tables in one changelog and others in another and also ignore others completely. Useful if you have test tables or code generated tables you don't want to include in your releases.

Some of the groovy tests need to be edited, .i.e remove some of the test cases, when building to ignore the changes. Or add the changes to the groovy tests where applicable.

DIFF - Getting "schemas equal" result for completely different schemas

$
0
0
I'm trying to compare 2 completely different schemas but getting below result - 

Diff Results:

Reference Database: 1@ jdbc:db2://D1:50005/N1(Default Schema: 1

)

Comparison Database: 1@ jdbc:db2://D2:50002/N2(Default Schema: 1

)

Product Name: EQUAL

Product Version: EQUAL

Missing Catalog(s): NONE

Unexpected Catalog(s): NONE

Changed Catalog(s): NONE

Missing Column(s): NONE

Unexpected Column(s): NONE

Changed Column(s): NONE

Missing Foreign Key(s): NONE

Unexpected Foreign Key(s): NONE

Changed Foreign Key(s): NONE

Missing Index(s): NONE

Unexpected Index(s): NONE

Changed Index(s): NONE

Missing Primary Key(s): NONE

Unexpected Primary Key(s): NONE

Changed Primary Key(s): NONE

Missing Schema(s): NONE

Unexpected Schema(s): NONE

Changed Schema(s): NONE

Missing Sequence(s): NONE

Unexpected Sequence(s): NONE

Changed Sequence(s): NONE

Missing Stored Procedure(s): NONE

Unexpected Stored Procedure(s): NONE

Changed Stored Procedure(s): NONE

Missing Table(s): NONE

Unexpected Table(s): NONE

Changed Table(s): NONE

Missing Unique Constraint(s): NONE

Unexpected Unique Constraint(s): NONE

Changed Unique Constraint(s): NONE

Missing View(s): NONE

Unexpected View(s): NONE

Changed View(s): NONE

Liquibase 'diff' Successful


Below are liquibase.properties entries -

driver=com.ibm.db2.jcc.DB2Driver
# JDBC driver
classpath=db2jcc.jar
classpath=db2jcc_license_cu.jar
classpath=db2jcc4.jar
url=jdbc:db2://D1:50005/N1
username=1
password=2
# default changelog to use, relative to classpath
changeLogFile=db.changelog.xml
### DIFF params ###
referenceUrl=jdbc:db2://D2:50002/N2
referenceUsername=1
referencePassword=2

Please let me know what could I have done wrong to get this result. 

Thanks,
Sid

Re : DIFF - Getting "schemas equal" result for completely different schemas

$
0
0
Please let me know if some different roles, permissions are needed.

Re : Adding comments to changesets no longer works reliably

$
0
0
Any news on this? This prevents us from using latest liquibase version...

Precondition to Check Whether Column is Nullable

$
0
0
I am using the liquibase XML DSL to modify primary/foreign keys on tables in a database. The target RDBMS systems are oracle and sql server. I want a precondition check in my changeset to check whether the column is nullable or not. If it does allow nulls, then I want to alter the column and make it not null. (Of course I will make sure the column has data before attempting to make it not null.) SQL Server appears to allow (or ignore) altering a column that is already not null to not null (and vice-versa in regards to a nullable column). Oracle, on the other hand, does not appear to allow this and generates an error. 

If there's no cleaner/better way to check whether a column is nullable or not (wouldn't know constraint name so couldn't use the constraint precondition), I'll leverage the failOnError="false" attribute.

Is there a better way in liquibase to check a column to determine whether it is nullable or not.

Thank you.

Upgrading from 2.0.5 to 3.2.0 - Problem with preConditions ?

$
0
0
I already saw in the forum one similar post, but i just created that one to show my scenario. I think the problem, is in the version 3.2.0 the preConditions are not working as I expected.

With the version 3.2.0 the following chaneSet is not working as should be:
  1. <changeSet author="e-ballo" id="RENAME_TEMPLATE_PACKAGE_PRICE_IDS">
  2. <preConditions onFail="MARK_RAN">
  3. <columnExists schemaName="ATI" tableName="ATI_SCENARIO_TEMPLATE_PACKAGES" columnName="PRICE_IDS"/>
  4. </preConditions>
  5.          <renameColumn schemaName="ATI" tableName="ATI_SCENARIO_TEMPLATE_PACKAGES" oldColumnName="PRICE_IDS" newColumnName="PROD_PRICE_MAP_IDS"/>
  6. </changeSet>
After execute this code in the databasechangelog table I get exectype: MARK_RAN, and of course the table it is not renamed.

If I only change the liquibase.jar and I run it with the version 2.0.5 all is working fine, and i get exectype : EXECUTED



Re : How to tag a database with liquibase 3.2.0 ?

$
0
0
I also received a null pointer using the tag database command, running with Ant.  But checking the DATABASECHANGELOG file I see that it did apply the tag I gave.
Buildfile: C:\Production\jboss_emr\g2\build-ci.xml
tag-database:
[tagDatabase] WARNING 7/8/14 10:09 AM: liquibase: Can not use class liquibase.ext.hibernate.database.HibernateSpringDatabase as a Liquibase service because org.springframework.beans.factory.support.BeanDefinitionRegistry is not in the classpath
[tagDatabase] INFO 7/8/14 10:09 AM: liquibase: Successfully acquired change log lock
[tagDatabase] INFO 7/8/14 10:09 AM: liquibase: Successfully released change log lock

BUILD FAILED
C:\Production\jboss_emr\g2\build-ci.xml:383: liquibase.exception.DatabaseException: java.lang.NullPointerException

Total time: 5 seconds
Here's my ant target.

    <target name="tag-database">
        <tagDatabase
                driver="${database.driver}"
                url="${database.url}"
                username="${database.username}"
                password="${database.password}"
                classpathref="g2.classpath"
                tag="R1.0"
                >
        </tagDatabase>
    </target>

All of the properties and references used work in my updateDatabase target so those are correct.

Liquibase generateChangeLog is failing - with Table already exists

$
0
0

Apologies, this is a cross post from Stackoverflow. 

I am getting a "table already exists" error from Liquibase when I run my Jhipster project:

[ERROR] liquibase - classpath:config/liquibase/master.xml: classpath:config/liquibase/changelog/db-changelog-001.xml::1::jhipster: Change Set classpath:config/liquibase/changelog/db-changelog-001.xml::1::jhipster failed. Error: Error executing SQL CREATE TABLE fc.T_USER (login VARCHAR(50) NOT NULL, .....: Table 't_user' already exists 

I have generated the Liquibase changelog file into config\liquibase\changelog directory using

liquibase --driver=com.mysql.jdbc.Driver ^ --classpath=C:\Users\Greg\.IntelliJIdea13\config\jdbc-drivers\mysql-connector-java-5.1.31-bin.jar ^ --changeLogFile=db-changelog-001.xml ^ --url="jdbc:mysql://localhost/fc" ^ --username=root ^ generateChangeLog 

So something is tricking Liquibase into trying to re-create the database when the changelog, I thought, was setting a baseline of the existing database.

  • Jhipster version: When I yo jhipster -v is says 1.2. When I nmp update jhipster is says I am on the latest = 17.2
  • Liquibase version tried 3.0, 3.1 and 3.2
  • Mysql database from XAMP
  • 2 tables are created in Mysql - databasechangelog and databasechangeloglock
  • databasechangelog remains empty and databasechangeloglock has a record added when Jhipster app is run

This process was working but not since move to new computer. When it was working I saw databasechangelog had a couple of records in it as well as 1 in databasechangeloglock

Tips on how to debug as welcome as an answer. Thanks

How to reference new change in xml file

$
0
0
I just created a change by extending liquibase.change.AbstractChange and registering it by calling iquibase.change.ChangeFactory.getInstance().register(YourChange.class)

Is there any way that I can use this new change without implementing my own change log parser?

Right now the ChangeFactory is picking up all the metadata but the Xml parser is not letting me use any of that metadata.

Re : Execute an Oracle sql script

$
0
0
Hi,

I am not sure if you are currently investigating this issue or not because the https://liquibase.jira.com/browse/CORE-1621 issue has closed status. So I am stating here the issue I encountered while trying to execute sqlplus using executeCommand.


I encountered following problems:
1. You cannot give commands like 'exit | sqlplus.exe' in the executeCommand tag.
2. I tried creating a separate (DOS) batch file to invoke command 'exit | sqlplus.exe user/pwd@conn @sqlfile.sql' and then tried invoking the batch file using the executeCommand. but it hanged like before. Strangely executing the batch file from DOS command line made sqlplus to quit after execution. It might also be interesting that passing exit through pipe to sqlplus makes sense if 'exit' is not part of the sql script as the last instruction. My script also had following command as the last instruction:
Exit 

So I believe there is still some issue with the executeCommand tag when sqlplus runs through it.

Kamran

Re : Execute an Oracle sql script

$
0
0

This is still a critical issue for us.

Is there a reason why this has been closed?

Thanks,

Uri

Re : Liquibase Jenkins Plugin

$
0
0

I love the concept and love the fact that the plugin works.

 

The job configuration input requires a log of information.  My preference would be if you had a mechanism on the global configuration to redefine database connections that jenkins jobs would refer to.  https://wiki.jenkins-ci.org/display/JENKINS/Publish+Over+SSH+Plugin is an example of a jenkins plugin that has a similar issue.  That feature would reduce the job parameters from 9 to 4 and would allow users to configure liquibase conversions without having direct access to the passwords.

 

I haven't looked at the code but it looks like the plugin is using jenkins' ${PATH} to find the liquibase executables.  My preference would be to configure this at the java classpath level.  That way liquibase can be maintained independently of the jenkins server and we could run multiple  liquibase versions with the same set of database drivers.

 

Again, this plugin is a great idea and the notion of having easy to read jenkins badges for the conversions is fantastic.  Please let the forum know what changes you are considering and people may volunteer to help with them.

Re : Upgrade 3.1.1 to 3.2.0 throws liquibase.exception.ValidationFailedException: Validation Failed: 1 change sets check sum .. is now: ..

$
0
0
It looks like the change isn't from either of the two issues you listed, but rather a change in how whitespace around nested text is handled. 

In 3.1.1, the <createProcedure> and <sql> tags were incorrectly including any whitespace you have around the tags in the checksum calculation, which made it easy for checksums to get changed when files are reformatted etc. 

Whitespace within the text is still preserved but it is no longer significant around the text. You should only see the problem in changeSets that have text nodes with whitespace around them.

I'll add a note to the release notes about the change in behavior. I don't think we want to revert the functionality because fixed logic is correct. If you have a changeSet that has the problem, the easiest solution is to add a <validCheckSum>...</validCheckSum> tag listing the new checksum. You can also set the md5sum column in databasechangelog to null and liquibase will recompute the checksums on the next run, but that needs to be done on every database and will affect runOnChange logic you may have.

Nathan

Generated duplicate constraint names

$
0
0
We have many entities in our system with similar names.  When I use the hibernate plugin to generate an initial schema (using the diffDatabaseToChangeLog command) I get duplicate constraint names.  For instance, given entities ChargeHeader and ChargeHeaderSent I get this:

<changeSet author="foobar(generated)" id="1404858920815-630">
      <addPrimaryKey columnNames="id" constraintName="CHARGE_HEADERPK" tableName="CHARGE_HEADER"/>
</changeSet>

<changeSet author="foobar(generated)" id="1404858920815-631">
      <addPrimaryKey columnNames="id" constraintName="CHARGE_HEADERPK" tableName="CHARGE_HEADER_SENT"/>
</changeSet>


Obviously this fails when I try to update the database with these changesets (ORA-02264: name already used by an existing constraint).  I also wonder why there is no flag for the column tag that would indicate which column is a primary key, rather than having all these addPrimaryKey tags.  That would avoid this duplicate name problem entirely.

Thanks,
Larry Kline

Re : preCondition onFail="CONTINUE"

$
0
0
Why can't CONTINUE be used for preConditions on changelogs?

The documentations says explicitly "Outside a changeset (e.g. at the beginning of the change log), only HALT and WARN are possible values.", but there is no explanation why.

I would like to have a "master" changelog which includes other "sub-changelogs". In these ones I would like to have a precondition check with CONTINUE or MARK_RAN, so that a whole sub-changelog can be skipped. Writing the precondition in every changeset would be much more work and has the risk of forgetting it on a changeset.

Re : Upgrade 3.1.1 to 3.2.0 throws liquibase.exception.ValidationFailedException: Validation Failed: 1 change sets check sum .. is now: ..

$
0
0
Actually I had the versions backwards. 3.2.0 introduced a regression in that it improperly includes leading and trailing spaces in the checksum. 

I will release a 3.2.1 version in the next couple days that will address the problem and restore the original checksums.

Nathan

Re : sqlFile tag not expanding placeholders

$
0
0
Hi
I tried parameter replacement in 3.2.0 against oracle and it didn't work for <SQLFILE>.
It did work for <SQL>.

This is the command line I'm using

java -DchangeId=1405045580= -jar ../../../standaloneCmdLineExample/liquibase-3.2.0-bin/liquibase.jar --defaultsFile=./liquibase.properties --changeLogFile=./simpleSQLFileExamplechangelogfile.xml update

This is the change log file

<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
     <property name="client" value="myClient"/> 
<changeSet author="tom" id="${changeId}">
  <sql endDelimiter="##">
begin
insert into info values( to_char( sysdate, 'YYYY/MM/DD HH24:MI:SS')||'value replacement in SQL tag ${client}');
end;--#/
</sql>
  <sqlFile dbms="oracle" encoding="utf8" endDelimiter="--#/" path="./simpleSQLFileExample.sql" relativeToChangelogFile="true" splitStatements="true" stripComments="true"/>
</changeSet>
</databaseChangeLog>


This is the contents of ./simpleSQLFileExample.sql

begin
 insert into info values( to_char( sysdate, 'YYYY/MM/DD HH24:MI:SS')||'value replacement in sqlFile tag ${client}');
end;
--#/

This is the result of select * from info

SQL*Plus: Release 11.2.0.2.0 Production on Fri Jul 11 14:21:34 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production

SQL> select * from info;

INFO
--------------------------------------------------------------------------------
2014/07/11 14:18:00value replacement in SQL tag myClient
2014/07/11 14:18:00value replacement in sqlFile tag ${client}

Thanks

b.t.w this is a great tool!

Tom

informix - performance - view generation - subselect

$
0
0
Hi,

I think there is a problem with the genration of views in informix (maybe also other dialects). I don't have any problems yet but after creating a view on a table with millions of rows a got performance problems. It seems, that on each call all entries on the database are fetched cause of an additional select within the view which is not needed.

Which code is responsible to generate the views?


Greets
Meleagros

Viewing all 2993 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>