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

Incorrect default charset for formatted sql files via maven plugin

$
0
0
Hi,

I have been trying to solve a problem I have with UTF-8 encoded sql scripts via the maven plugin.  Data is being inserted into the database with encoding "windows-1252", even though the file.encoding System property is set to "UTF-8".

I tried various ways to workaround this, maven settings, plugins etc, but to no avail.  Working with the code I see that, even though the system property for file.encoding is UTF-8, the Charset.defaultCharset() still returns "windows-1252".

Further testing (via groovy scripts) seems to verify the file.encoding has no effect on the default charset, contrary to the information I found online:

  1. $ groovy -Dfile.encoding=test -e "println System.getProperty(\"file.encoding\")"
  2. test
  3. $ groovy -Dfile.encoding=UTF-8 -e "println java.nio.charset.Charset.defaultCharset().name()"
  4. windows-1252


My "solution" at this point appears to be to fork the code and change the default charset in UtfBomAwareReader to use the file.encoding property (diff is below), but I also wanted to ask is this is a problem for others, and whether this change would make sense going into the main codebase?

Best regards,
Gary


  1. diff --git a/liquibase-core/src/main/java/liquibase/resource/UtfBomAwareReader.java b/liquibase-core/src/main/java/liquibase/resource/UtfBomAwareReader.java
  2. index af65682..7297f71 100644
  3. --- a/liquibase-core/src/main/java/liquibase/resource/UtfBomAwareReader.java
  4. +++ b/liquibase-core/src/main/java/liquibase/resource/UtfBomAwareReader.java
  5. @@ -28,7 +28,7 @@ public class UtfBomAwareReader extends Reader {

  6.        public UtfBomAwareReader(InputStream in) {
  7.                pis = new PushbackInputStream(in, 4);
  8. -               this.defaultCharsetName = Charset.defaultCharset().name();
  9. +               this.defaultCharsetName = System.getProperty("file.encoding");
  10.        }

  11.        public UtfBomAwareReader(InputStream in, String defaultCharsetName) {

Re : Incorrect default charset for formatted sql files via maven plugin

$
0
0
A little more research led me to the following stackoverflow page (http://stackoverflow.com/questions/8177089/charset-defaultcharset-get-different-result-under-jdk1-7-and-jdk-1-6) which mentions that Charset.defaultCharset() is not influenced by -Dfile.encoding, also : "The preferred way to change the default encoding used by the VM and the runtime system is to change the locale of the underlying platform before starting your Java program."

It seems to me that relying on Charset.defaultCharset() leads to portability problems, i.e. I would prefer not to have to ask each developer to adjust their environment just to run liquibase.  I suspect the most portable solution would be to introduce a "defaultCharset" parameter to the Maven plugin, as relying on the file.encoding System Parameter is also not a great solution (although I can set this via a Maven plugin).

Invalid content was found starting with element 'preconditions' - with onFail="MARK_RAN"

$
0
0
Similar to http://forum.liquibase.org/topic/preconditions-onfail-mark-ran-causes-parser-error, I'm having an issue including a precondition. I don't know if it's a bug or if I'm just using it incorrectly?

I need to drop a column if it exists.

I can get around it by using stopOnFailure="false" but I'd rather do it a bit cleaner than that.

Here is the current one:
  1.     <changeSet id="107-revert" author="damon">
            <preconditions onFail="MARK_RAN">
                <columnExists tableName="the_table" columnName="the_column" />
            </preconditions>
            <comment>dont need the column
            </comment>
            <dropColumn tableName="the_table" columnName="the_column" />
            <rollback />
        </changeSet>


I have verified the comment tag is after the precondition, and have also tried no comment tag and an empty tag.
I have tried with and without the rollback.
I don't see any typos, but it seems like it's not picking up the dropColumn?


It throws this error:

liquibase.exception.ChangeLogParseException: Error parsing line 83 column 36 of v005/master.xml: cvc-complex-type.2.4.a: Invalid content was found starting with element 'preconditions'. One of '{"http://www.liquibase.org/xml/ns/dbchangelog/1.9":validCheckSum, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":preConditions, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":tagDatabase, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":comment, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createTable, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropTable, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createView, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":renameView, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropView, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":insert, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addColumn, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":sql, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createProcedure, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":sqlFile, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":renameTable, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":renameColumn, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropColumn, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":modifyColumn, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":mergeColumns, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createSequence, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":alterSequence, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropSequence, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createIndex, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropIndex, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addNotNullConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropNotNullConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addForeignKeyConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropForeignKeyConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropAllForeignKeyConstraints, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addPrimaryKey, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropPrimaryKey, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addLookupTable, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addAutoIncrement, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addDefaultValue, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropDefaultValue, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addUniqueConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropUniqueConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":customChange, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":update, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":delete, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":loadData, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":executeCommand, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":stop, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":rollback, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":modifySql}' is expected.
    at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(XMLChangeLogSAXParser.java:109)
    at liquibase.parser.core.xml.XMLChangeLogSAXHandler.handleIncludedChangeLog(XMLChangeLogSAXHandler.java:561)
    at liquibase.parser.core.xml.XMLChangeLogSAXHandler.startElement(XMLChangeLogSAXHandler.java:164)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(XMLChangeLogSAXParser.java:101)
    at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:216)
    at liquibase.Liquibase.listUnrunChangeSets(Liquibase.java:776)
    at liquibase.Liquibase.reportStatus(Liquibase.java:797)
    at liquibase.Liquibase.reportStatus(Liquibase.java:790)
    at liquibase.integration.commandline.Main.doMigration(Main.java:840)
    at liquibase.integration.commandline.Main.main(Main.java:133)
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'preconditions'. One of '{"http://www.liquibase.org/xml/ns/dbchangelog/1.9":validCheckSum, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":preConditions, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":tagDatabase, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":comment, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createTable, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropTable, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createView, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":renameView, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropView, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":insert, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addColumn, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":sql, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createProcedure, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":sqlFile, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":renameTable, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":renameColumn, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropColumn, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":modifyColumn, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":mergeColumns, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createSequence, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":alterSequence, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropSequence, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createIndex, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropIndex, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addNotNullConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropNotNullConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addForeignKeyConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropForeignKeyConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropAllForeignKeyConstraints, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addPrimaryKey, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropPrimaryKey, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addLookupTable, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addAutoIncrement, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addDefaultValue, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropDefaultValue, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addUniqueConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropUniqueConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":customChange, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":update, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":delete, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":loadData, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":executeCommand, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":stop, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":rollback, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":modifySql}' is expected.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(XMLChangeLogSAXParser.java:101)
    ... 22 more
Liquibase status Failed: Error parsing line 83 column 36 of v005/master.xml: cvc-complex-type.2.4.a: Invalid content was found starting with element 'preconditions'. One of '{"http://www.liquibase.org/xml/ns/dbchangelog/1.9":validCheckSum, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":preConditions, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":tagDatabase, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":comment, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createTable, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropTable, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createView, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":renameView, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropView, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":insert, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addColumn, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":sql, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createProcedure, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":sqlFile, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":renameTable, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":renameColumn, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropColumn, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":modifyColumn, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":mergeColumns, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createSequence, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":alterSequence, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropSequence, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":createIndex, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropIndex, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addNotNullConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropNotNullConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addForeignKeyConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropForeignKeyConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropAllForeignKeyConstraints, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addPrimaryKey, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropPrimaryKey, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addLookupTable, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addAutoIncrement, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addDefaultValue, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropDefaultValue, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":addUniqueConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":dropUniqueConstraint, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":customChange, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":update, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":delete, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":loadData, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":executeCommand, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":stop, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":rollback, "http://www.liquibase.org/xml/ns/dbchangelog/1.9":modifySql}' is expected.


Error on documentation

$
0
0
Hi,

First, i'm reporting typo on the documentation http://www.liquibase.org/documentation/changes/sql.html

The documantation YAML version does'nt display correctly tabulations and is missing character, i want to say on YAML it is pretty important.

changeSet: id: sql-example author: liquibase-docs changes: - sql: comment: What about Bob?
is in reality :
- changeSet: id: sql-example author: liquibase-docs changes: - sql: comment: What about Bob?
And second will be the extension yaml

When i execute 
  1. "./liquibase  --changeLogFile=db.changelog-1.1.yml  --logLevel=debug  update"

The system display :
  1. Liquibase update Failed: Cannot find parser that supports db.changelog-1.1.yml
  2. SEVERE 5/8/14 1:35 PM:liquibase: Cannot find parser that supports db.changelog-1.1.yml

Solution => replace yml by yaml (just in case people are looking for it)

It would be nice to handle both extension within liquibase:) and manage errors message too...

Thanks ;)

Re : character encoding using insert

$
0
0
Hi,

I too have been having encoding issues - but with formatted sql files.  One thing that worked for me was to set the following environment variable:
JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8
 
This appears to change the locale that Charset.defaultCharset() uses to determine the default encoding.  I don't know if it will help with xml changesets though - might be worth a try.

Regards,
Gary

Re : Invalid content was found starting with element 'preconditions' - with onFail="MARK_RAN"

$
0
0
I would say it is expecting preConditions instead of preconditions in your first tag. So being case sensitive.

Regards,
Christian

Re : character encoding using insert

$
0
0
Have you tried encoding your files in win1252 instead of UTF-8?
I manage to insert special characters (åäö) in our database but we use UTF-8 in the database as well.

Regards,
Christian

Re : liquibase 3.1.1 with ant and sql anywhere

$
0
0
Can you give the Ant and Maven configurations you used to generate the SQL? I can try to compare the settings and see which one is missing in the Ant task.

Re : How to handle database changes made by an automatic upgrade script?

$
0
0
Please? 
Could anyone help me here? I will appreciate any help

Re : ORA-00911: invalid character

$
0
0
Have you tried using endDelimiter=";"?

Regards

Generation of empty changelog

$
0
0
Hello,

I'm a new user.
I've got an existing database (MS SQL Server 2008 R2), I'm trying to generate the first change log, but the generated file is empty.

I've launched the following command:
liquibase  --logLevel=debug --changeLogFile="./changelog.xml" generateChangeLog

And here is the output I have:

DEBUG 12/05/14 17:05:liquibase: Connected to xxxxx@jdbc:sqlserver://xxxx:1433;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustServerCertificate=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=xxxx;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite;
DEBUG 12/05/14 17:05:liquibase: Setting auto commit to false from true
DEBUG 12/05/14 17:05:liquibase: Executing QUERY database command: select schema_name()
DEBUG 12/05/14 17:05:liquibase: Executing QUERY database command: SELECT CONVERT(varchar(100), SERVERPROPERTY('COLLATION'))
INFO 12/05/14 17:05:liquibase: .\changelog.xml does not exist, creating
DEBUG 12/05/14 17:05:liquibase: MissingObjectChangeGenerator type order:     liquibase.structure.core.Catalog    liquibase.structure.core.Schema    liquibase.structure.core.Sequence    liquibase.structure.core.StoredProcedure    liquibase.structure.core.Table    liquibase.structure.core.Column    liquibase.structure.core.PrimaryKey    liquibase.structure.core.ForeignKey    liquibase.structure.core.UniqueConstraint    liquibase.structure.core.Index    liquibase.structure.core.View
DEBUG 12/05/14 17:05:liquibase: UnexpectedObjectChangeGenerator type order:     liquibase.structure.core.Catalog    liquibase.structure.core.ForeignKey    liquibase.structure.core.Schema    liquibase.structure.core.StoredProcedure    liquibase.structure.core.UniqueConstraint    liquibase.structure.core.View    liquibase.structure.core.Table    liquibase.structure.core.PrimaryKey    liquibase.structure.core.Column    liquibase.structure.core.Index    liquibase.structure.core.Sequence
DEBUG 12/05/14 17:05:liquibase: ChangedObjectChangeGenerator type order:     liquibase.structure.core.Catalog    liquibase.structure.core.ForeignKey    liquibase.structure.core.Schema    liquibase.structure.core.Sequence    liquibase.structure.core.StoredProcedure    liquibase.structure.core.Table    liquibase.structure.core.Column    liquibase.structure.core.PrimaryKey    liquibase.structure.core.Index    liquibase.structure.core.UniqueConstraint    liquibase.structure.core.View
Liquibase 'generateChangeLog' Successful

And here is the generated changelog.xml:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"/>

User used to connect is database owner.

Any idea what's wrong?

Re : How to handle database changes made by an automatic upgrade script?

$
0
0
But not all of the changes will be handled manually. Mainly, all changes during installation and upgrades of Wordpress will be made by the automatic update script of Wordpress.

From a Liquibase  user point of view, 
Can I just ignore them? and put only my own changes in Liquibase changelog file?
Yes, you can just ignore them—you should just ignore them.

Liquibase is a tool that simply keeps track of the fact that commands that look a certain way were executed at some date.  That's really all it does.  It follows that commands executed by other tools can happen at any point, can take any action they want, and, for better or for worse, Liquibase will have no idea that they happened.  Liquibase is not a "structure police" program—it is not fundamentally set up to ensure that modifications to database structures are managed or anything like that.

Probably if you know that all sorts of other tools are going to be mucking with your database you should make liberal use of preconditions in your changesets to make sure that things execute only when the database is in a proper state.

Best,

Re : Generation of empty changelog

$
0
0
Are there multiple databases and/or schemas on that server? It appears that Liquibase is getting information for a different database or schema than what you are expecting. 

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

Re : Generation of empty changelog

$
0
0
Yes, multiple databases and multiple schema per database.

I've put the databaseName in the parameter of the connection url, but didn't specify the schema anywhere.

From what I found it's possible to specify a schema in the url as well, but I'm guessing only one.
Is there any way to tell liquibase to scan multiple schema?

While I'm on schemas, is there also a way to specify in which schema liquibase will put it's tables, or will it be the one specified in the connection url as well?

Thanks,
Nicolas.

3.1.1 Failed tests: minimumRequiredIsValidSql(liquibase.verify.change.VerifyChangeClassesTest)

$
0
0
Hi, I've checked out liquibase-parent-3.1.1 and run 'mvn package' but get a failure on minimumRequiredIsValidSql(liquibase.verify.change.VerifyChangeClassesTest) Details: Unexpected difference in /home/bbirch1/workspace/liquibase/liquibase/liquibase-core/src/test/java/liquibase/verify/saved_state/minimumRequiredIsValidSql/createProcedure/informix.sql expected:<...Parameter: procedure[Text]=CREATE OR REPLACE P...> but was:<...Parameter: procedure[Body]=CREATE OR REPLACE P...>" type="org.junit.ComparisonFailure I tried both JDK-6 and 7 from Oracle with the same result. However when I built the latest ~3.2.0 from github it's fine. Can anyone shed any light on this?

Re : 3.1.1 Failed tests: minimumRequiredIsValidSql(liquibase.verify.change.VerifyChangeClassesTest)

$
0
0
OK so I cherry-picked 4b20c12287f95180c445f89dcf7a784c7bfbb7c4 and now it builds. Methinks the release was built after the tag. But I cannot find out the Git ID it was built from by looking at the contents of the ZIP.

SqlFile finds no file but does not fail

$
0
0
Hi,

I have been trying to understand for hours why my changelog was being applied yet changes were not visible in the schema. After debugging the liquibase code I find that when an sql file is not found an empty statement is being sent to the DB! Is that really desired behavior?

What I see:
  1. The logging shows the files as 'executed' which is quite false!
  2. I get no error, warning, failures.
  3. When I run with updateSQL I see the DATABASECHANGELOG statements and nothing else.
How do I get this:
  1. have one changeset with one sqlFile block where I specify just the path
  2. I am running against an MSSQL server
  3. I am running on windows using Liquibase 3.1.1 and Java 1.7.0_51
This is annoying for regular changesets as it requires extra testing. It is very dangerous for runAlways changesets as it can result in non-deterministic behavior.

Have I missed something?

cheers,
Florian

Performance issue on large DB with 3.1.1

$
0
0
Hello,

We have recently filed an issue (https://liquibase.jira.com/browse/CORE-1883) that prevents us from using latest liquibase versions (3.1.1). We are currently stuck with 2.0.5, which works for most usage but has some shortcomings warranting an upgrade to newer versions. Investigating the problem in a limited way, we found that the huge memory consumption we observe appears to be caused by use of a columnExists precondition which creates complete snapshot of the whole database and columns... 

Does this ring some bell? Do we need to investigate further or is this something known? 

Thanks for your help,

Arnaud

Re : SqlFile finds no file but does not fail

Re : SqlFile finds no file but does not fail

$
0
0
I did a bit of digging and as I thought this behavior has changed from 2.0.x to 3.1.x

in 2.0.x the SQLFileChange.java checks for the existence of the file.

in 3.1.x this functionality has been moved to StreamUtil.java where no such checks are done. 

I was going to submit a bug, but the git repository does not seem to be setup to allow it.

EDIT: issues are in jira. They have a bug for this - CORE-1828

cheers,
Florian
Viewing all 2993 articles
Browse latest View live


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