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

Liquibase 3.2.2, DB : Vertica 7.1 : defaultSchemaName not used to create tables

$
0
0
Hello,

I have an issue when using parameter defaultSchemaName. Except Liquibase tables, Tables are created in default schema of username and not in .defaultSchemaName.
Here are the logs :
  1. DEBUG 1/20/15 10:15 AM: liquibase: Executing QUERY database command: SELECT LOCKED FROM vddbadev2.DATABASECHANGELOGLOCK WHERE ID=1
    DEBUG 1/20/15 10:15 AM: liquibase: Lock Database
    DEBUG 1/20/15 10:15 AM: liquibase: Executing UPDATE database command: UPDATE vddbadev2.DATABASECHANGELOGLOCK SET LOCKED = TRUE, LOCKEDBY = 'vd2263.angers.cnp.fr (158.157.108.11)', LOCKGRANTED = '2015-01-20 10:15:29.803' WHERE ID = 1 AND LOCKED = FALSE
    INFO 1/20/15 10:15 AM: liquibase: Successfully acquired change log lock
    DEBUG 1/20/15 10:15 AM: liquibase: Resolving XML entity name='null', publicId='null', baseURI='null', systemId='http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd'
    DEBUG 1/20/15 10:15 AM: liquibase: Found namespace details class liquibase.parser.core.xml.StandardNamespaceDetails for http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd
    DEBUG 1/20/15 10:15 AM: liquibase: Local path for http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd is liquibase/parser/core/xml/dbchangelog-2.0.xsd
    DEBUG 1/20/15 10:15 AM: liquibase: Successfully loaded XSD from liquibase/parser/core/xml/dbchangelog-2.0.xsd
    DEBUG 1/20/15 10:15 AM: liquibase: Resolving XML entity name='null', publicId='null', baseURI='null', systemId='http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd'
    DEBUG 1/20/15 10:15 AM: liquibase: Found namespace details class liquibase.parser.core.xml.StandardNamespaceDetails for http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd
    DEBUG 1/20/15 10:15 AM: liquibase: Local path for http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd is liquibase/parser/core/xml/dbchangelog-2.0.xsd
    DEBUG 1/20/15 10:15 AM: liquibase: Successfully loaded XSD from liquibase/parser/core/xml/dbchangelog-2.0.xsd
    DEBUG 1/20/15 10:15 AM: liquibase: Executing QUERY database command: SELECT MD5SUM FROM vddbadev2.DATABASECHANGELOG WHERE MD5SUM IS NOT NULL
    INFO 1/20/15 10:15 AM: liquibase: Reading from vddbadev2.DATABASECHANGELOG
    DEBUG 1/20/15 10:15 AM: liquibase: Executing QUERY database command: SELECT FILENAME,AUTHOR,ID,MD5SUM,DATEEXECUTED,ORDEREXECUTED,EXECTYPE,DESCRIPTION,COMMENTS,TAG,LIQUIBASE FROM vddbadev2.DATABASECHANGELOG ORDER BY DATEEXECUTED ASC, ORDEREXECUTED ASC
    DEBUG 1/20/15 10:15 AM: liquibase: Executing QUERY database command: select count(*) from vddbadev2.DATABASECHANGELOGLOCK
    DEBUG 1/20/15 10:15 AM: liquibase: ./dbchangelog.xml: 0.0.0-0.1.0/dbchangelog_0.0.0-0.1.0.xml::1::MFI: Computed checksum for  as d41d8cd98f00b204e9800998ecf8427e
    DEBUG 1/20/15 10:15 AM: liquibase: ./dbchangelog.xml: 0.0.0-0.1.0/dbchangelog_0.0.0-0.1.0.xml::2::MFI: Computed checksum for tagDatabase:[
        tag="R_0.0.0"
    ] as 61e85b5b7cc792f6b29b7db13caf7709
    DEBUG 1/20/15 10:15 AM: liquibase: ./dbchangelog.xml: 0.0.0-0.1.0/dbchangelog_0.0.0-0.1.0.xml::2::MFI: Computed checksum for 7:61e85b5b7cc792f6b29b7db13caf7709: as 69f70b61ff88387e9d518bd47d5c1406
    DEBUG 1/20/15 10:15 AM: liquibase: ./dbchangelog.xml: 0.0.0-0.1.0/dbchangelog_0.0.0-0.1.0.xml::3::MFI: Running Changeset:0.0.0-0.1.0/dbchangelog_0.0.0-0.1.0.xml::3::MFI
    DEBUG 1/20/15 10:15 AM: liquibase: ./dbchangelog.xml: 0.0.0-0.1.0/dbchangelog_0.0.0-0.1.0.xml::3::MFI: Changeset 0.0.0-0.1.0/dbchangelog_0.0.0-0.1.0.xml::3::MFI
    DEBUG 1/20/15 10:15 AM: liquibase: ./dbchangelog.xml: 0.0.0-0.1.0/dbchangelog_0.0.0-0.1.0.xml::3::MFI: fichier : 01_TAB_MFI_RUN_EXECUTE.sql
    DEBUG 1/20/15 10:15 AM: liquibase: ./dbchangelog.xml: 0.0.0-0.1.0/dbchangelog_0.0.0-0.1.0.xml::3::MFI: Reading ChangeSet: 0.0.0-0.1.0/dbchangelog_0.0.0-0.1.0.xml::3::MFI
    DEBUG 1/20/15 10:15 AM: liquibase: ./dbchangelog.xml: 0.0.0-0.1.0/dbchangelog_0.0.0-0.1.0.xml::3::MFI: Executing Statement: liquibase.statement.core.RawSqlStatement
    DEBUG 1/20/15 10:15 AM: liquibase: ./dbchangelog.xml: 0.0.0-0.1.0/dbchangelog_0.0.0-0.1.0.xml::3::MFI: Executing EXECUTE database command: create table MFI_RUN_EXECUTE

I'm using Liquibase 3.2.2 with Vertcia extension 1.2

Can anyone help me on this ?

Regards,
Mohamed Boutkhil


Lock a changelog to a single schema?

$
0
0
Is there a way to limit a changelog to run in a single schema?

I see that there's "defaultSchemaName" to set a default, but is there also a way to restrict a changelog?

includeObjects throws exception in command line

$
0
0
I am using liquibase 3.3.2 and trying out the includeObjects. This is the command line (adapted to hide username/password details)

cmd /c liquibase --driver=com.mysql.jdbc.Driver --classpath=<pathtomyjar> --includeObjects="table:(?i)actor*" --diffTypes="data" --changeLogFile=<path_to_log_file> --username=<mysqluser>   --password=<mysqlpassword> --url=<jdbcurl>  generateChangeLog

This is the exception thrown.


Unexpected error running Liquibase: Unknown parameter: 'includeObjects'

SEVERE 1/22/15 3:17 PM: liquibase: Unknown parameter: 'includeObjects'
liquibase.exception.CommandLineParsingException: Unknown parameter: 'includeObje
cts'
        at liquibase.integration.commandline.Main.parseOptions(Main.java:702)
        at liquibase.integration.commandline.Main.run(Main.java:124)
        at liquibase.integration.commandline.Main.main(Main.java:94)

Can any point what I am doing wrong?

Thanks in advance
Sriram

createProcedure and runOnChange

$
0
0
I'm having difficulty reconciling the advice in the createProcedure documentation .

Often times it is best to use the CREATE OR REPLACE syntax along with setting runOnChange=’true’ on the enclosing changeSet tag. [...]  The advantage to this approach is that it keeps your change log smaller and allows you to more easily see what has changed in your procedure code through your source control system’s diff command.
The advantage is pretty clear, but the disadvantage is that rollback becomes a big headache. If you roll out a migration that breaks in an unforeseen way, you need a way to get the old version(s) of the procedure back again.

One approach I can imagine to deal with this is to copy the previous version of the file to a "rollback" file, which is fine as far as it goes, but has two problems. The first is that developers have to remember to do this; this can be mitigated with comments and code reviews, but is still a concern. The second is that you only get one level of rollback with this approach. Once you rollback a "re-run" migration, the change set is gone from the database change log table.

How do people handle this? Are you following the advice on the docs and accepting that rollback is difficult to manage, or do you ignore the advice and put migrations of procedures into separate files?

How to prevent running dropAll in the wrong database

$
0
0
What's the best way to prevent running dropAll in the wrong database.

Is there any precondition that could prevent running dropAll based on some condition (maybe a table name)?
<preConditions>
<tableExists tableName="A______________________A"/>
</preConditions>

generateChangeLog Failure failure for unknown reason

$
0
0
Hi all

So I'm looking at liquibase to help with some DB migration issues I'm seeing.

My app uses 5 schemas.  I started running generate schema one at a time to list out the changesets.  Everything worked fine except for one, which simply gives me the output

Liquibase generateChangeLog Failed: Unknown Reason


Is there any way to see logs as to why this might fail?  I'm using an RPM of 3.1.0.

Re : generateChangeLog Failure failure for unknown reason

$
0
0
Ok, small but not a lot more detail update.

I upgraded to 3.3.1 and am at least able to get this output:

Unexpected error running Liquibase: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

Anywhere that I would be able to see a full stack trace?  Playing with more options did get me this..


SEVERE 2/4/15 2:25 AM: liquibase: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

        at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:155)

        at liquibase.integration.commandline.Main.doMigration(Main.java:940)

        at liquibase.integration.commandline.Main.run(Main.java:177)

        at liquibase.integration.commandline.Main.main(Main.java:96)

Caused by: liquibase.command.CommandExecutionException: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

        at liquibase.command.AbstractCommand.execute(AbstractCommand.java:13)

        at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:153)

        ... 3 more

Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0

        at java.util.ArrayList.rangeCheck(ArrayList.java:571)

        at java.util.ArrayList.get(ArrayList.java:349)

        at liquibase.change.ColumnConfig.<init>(ColumnConfig.java:116)

        at liquibase.change.AddColumnConfig.<init>(AddColumnConfig.java:16)

        at liquibase.diff.output.changelog.core.MissingIndexChangeGenerator.fixMissing(MissingIndexChangeGenerator.java:62)

        at liquibase.diff.output.changelog.ChangeGeneratorChain.fixMissing(ChangeGeneratorChain.java:44)

        at liquibase.diff.output.changelog.ChangeGeneratorFactory.fixMissing(ChangeGeneratorFactory.java:99)

        at liquibase.diff.output.changelog.DiffToChangeLog.generateChangeSets(DiffToChangeLog.java:140)

        at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:120)

        at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:71)

        at liquibase.diff.output.changelog.DiffToChangeLog.print(DiffToChangeLog.java:59)

        at liquibase.command.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:54)

        at liquibase.command.AbstractCommand.execute(AbstractCommand.java:8)

        ... 4 more

Re : generateChangeLog Failure failure for unknown reason

$
0
0
That is about as full of a stack trace as you are likely to get. Including the command line option --logLevel=debug (if you haven't already) will add more detail.

I went and looked at the source for that - here is a link to the code at github:


I would guess that the issue is in the part where it says:

fk . getPrimaryKeyColumns() . get( 0 )

It looks like the code does some checking to ensure that the foreign key columns list has a size of 1, but it does not check to see if the foreign key primary key columns list has a size > 0. 

If you can run it with --logLevel=debug, I think it will tell you which table it is having problems with. That should provide more insight into what is happening. 

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Re : generateChangeLog Failure failure for unknown reason

$
0
0
Hi,

Actually no, no matter how much logging I add it doesn't say what table is affected.  With some code hacking I was able to identify which FK is having the issue.  However, I'm having much larger concerns which seem to warrant a separate topic.

John

generateChangeLog for multiple schemas in MySQL

$
0
0
Hi,

I have an app, not too old, that runs on MySQL with 5 schemas.  I was looking to leverage liquibase going forward to manage schema changes, and following the guides it indicated I should first generate the schema from a clean state to make sure all metadata is present.  Now, when I connect my app to the db, the JDBC URL is simply jdbc:mysql://localhost:3306/, e.g. no default database selected.  

I've also at this point hacked up the liquibase code a bit to support schemas as a parameter in generateChangeLog.  It looks like it was processed, just no easy way to get the value in.  I can see in the code through log output that it is picking up all of the schemas specified.  However, I've noticed that the schema generated seems to have to do with the JDBC URL.  Since the format I use means no DB selected, I'm not getting any diff output.  When I do specify a DB there, I only get that schema as output.  The problem is that my FKs are cross schema, so I need to generate some of the schemas together.

Is this at all possible to do? Is there a section of code I could look at that might be using the connection DB instead of the specified values?

Of course if I get this stuff working, I'll see about contributing it back.

John

Why does create table disregard the specified order of columns?

$
0
0
Hi,

I'm just getting started with Liquibase and have noticed that the create statement generated is not respecting the column order of the create table statement. Instead it creates the columns in alphabetical order. Is this the way it should be or am I doing something wrong.

Kind Regards

Mikael

and database-independent way of using next sequence number?

$
0
0

Hi,

Using Liquibase 3.3.2.  I'm trying to write a db-independent way of specifying that the PK's for my data are to be the next value from a given sequence.  I've read and see how to make it specific to a given DB type, but I'd like to be able to write my changeSet to be more database independent.  I know I could write multiple changeSets, one for each DB type I need to support - but that's getting unwieldy.  Looking at the dbchangelog-3.3.xsd, the "column" attribute group has some promising elements such as 'valueSequenceNext', or 'defaultValueSequenceNext'.  However, those elements aren't enabled in the "column" element defined inside the loadData, so are unavailable.

Anyone able to help out here?

Thanks!

Bob.

Dropwizard migrations Liquibase new changeset not migrating

$
0
0

I've added new changeset to migrations.xml but when I run db migration config-file it doesn't apply new changeset but just with below output:

INFO  [2015-02-10 12:59:34,193] liquibase: Successfully acquired change log lock
INFO  [2015-02-10 12:59:34,809] liquibase: Reading from public.databasechangelog
INFO  [2015-02-10 12:59:34,821] liquibase: Successfully released change log lock

I have two changesets and only the first one is applied. For example:

<changeSet id="1" author="me">

<changeSet id="2" author="me">

Also I only see first changeset entry under databasechangelog table which is strange.

How do I make it apply my new changeset?

Re : Dropwizard migrations Liquibase new changeset not migrating

Liquibase taking too long to execute changeset

$
0
0
Hi 

Liquibase Version:3.2.0
Database Version: Oracle 12c
Java Version: 1.7
Jenkins Version: 1.544
Maven Version: 3.1.1
We are facing severe performance issue with liquibase particularly on DDL statement with precondition.

<changeSet author="unknown" id="20141216-0" >
        <preConditions onFail="MARK_RAN">
            <not>
            <columnExists tableName="COMMUNICATION" columnName="REPORTID" />
            </not>
        </preConditions>
        <addColumn tableName="COMMUNICATION">
            <column name="REPORTID" type="BIGINT"/>
        </addColumn>
</changeSet>

The execution of the above changeset took approximately 4300702ms (1.2hrs). The table itself do not have any much data.

We are doing deployment to the database using Jenkins and maven. The Jenkins server is not co-located with the database server.
However we do not see any network traffic between Jenkins and DB server, no increase usage of memory or CPU.

1. Is there any known issue with using pre-conditions?
2. How can we improve the performance with the changeset?
3. Will there be a performance improvement if Jenkins (from where maven will run the liquibase) and the database servers are located closer?

We got to abort production build due to above issue, appreciate if someone can shed some light in these areas.

Thanks in advance.
Sayee


Re : Liquibase taking too long to execute changeset

$
0
0
How many rows and columns are in the current COMMUNICATION table? What else is going on when you try to run this update? Are there indexes/constraints/etc. on the table?

My guess is that the problem is not with Liquibase - you can run "liquibase updateSQL" to see what SQL is generated, and it is most likely very simple. So the problem is probably on the database end of things. 

Steve Donie
Principal Software Engineer
Datical, Inc. http://www.datical.com/

Re : Liquibase taking too long to execute changeset

$
0
0
Hi Steve

Thanks for your reply.

1. The table is empty.
2. There are no indexes added at that point.
3. Primary key and foriegn key constraints are present.

If we debug and see there are lots of checks happening on the database

SELECT TEXT FROM ALL_VIEWS WHERE upper(VIEW_NAME)='ABC' AND OWNER='XYZ'
For this particular scenario, it has checked nearly 963 such select statements.

We also think if the precondition check fails, (i.e. in this case the column is not present in the table) thats when liquibase does all these check on the database before adding a column to the table.

Any thoughts?

Regards
Sayee


Re : Table and column remarks => dbDoc

$
0
0
I know this is a three-year-old topic, but I'd like to see this feature too. The DBDoc output is great, but it would be so much better if it included the remarks.

There's an open-source product called SchemaSpy which interrogates a database and builds entity-relationship diagrams and so on, and it includes comments that were inserted into the schema with the COMMENT ON statement. It, too, is written in Java and usess JDBC; so it should be possible.

Re : Liquibase 3.2.2, DB : Vertica 7.1 : defaultSchemaName not used to create tables

$
0
0
Hi, 

Sorry for the late response - i missed your post.

I think this is due to the parameter not updating the search_path so that all new tables will use the default parameter.
I'll try to patch up the extension and upload a new version.

in any case you can directly specify the schema name in the change (although redundant...)

p.s. if you have issues related to the extension, feel free to mail me at cohenjo@hp.com
I don't always follow the forum - sorry.

Regards,
Jony

Informix generateChangeLog issue

$
0
0
I am using Liquibase version 3.3.2 to create a changelog for my existing Informix DB using the generateChangeLog command.

The changelog.xml (483 Kb) is created successfully but contains no changesets! I have tried using other versions of Liquibase but no success. Is it a Liquibase bug?

Thanks in advance for the help.

Here is how the changelog.xml looks like -
Viewing all 2993 articles
Browse latest View live


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