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

Re : Run Migrator pulling changelogs from a .JAR file (Spring boot)

$
0
0
Hi Steve,

Now It works with :

java -jar liquibase.jar --driver=com.mysql.jdbc.Driver --classpath=myapplication.jar: mysqldriver.jar  --changeLogFile=/liquibase/current-changelog.xml  --url=jdbc:mysql://localhost/liquibase --username=root --password=root updateSQL > /tmp/script.sql

Thx a lot

Re : Not able to generate rollback scripts by tag in offline mode

$
0
0
In simple words I want to generate a rollback sql script for a particular tag using maven plugin. I am trying with above approach and it doesn't work for me. Plz let me know any alternatives.

Re : Not able to generate rollback scripts by tag in offline mode

$
0
0
In simple words I want to generate a rollback sql script for a particular tag using maven plugin. I am trying with above approach and it doesn't work for me. Plz let me know any alternatives.

Re : Not able to generate rollback scripts by tag in offline mode

$
0
0
The simple words are the problem here. Too simple. The only way anyone can help you is if you explain the problem in more detail. Right now, I don't even understand your objective. What should the rollback script roll back? What do expect the end state of the system to be? What have you tried that didn't work? What problems did you experience?

Perhaps you could read this article - it explains how to ask questions that get answers. If you plan on doing this for a living, it is very good advice.

http://www.catb.org/esr/faqs/smart-questions.html

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

Change set checksum and parameter substitution

$
0
0
Hello,

I have a create table change set
  1.     <changeSet id="1" author="bob">
  2.         <createTable tableName="department" tablespace="${department.tablespace}">
  3.             <column name="id" type="int">
  4.                 <constraints primaryKey="true" nullable="false"/>
  5.             </column>
  6.             <column name="name" type="varchar(50)">
  7.                 <constraints nullable="false"/>
  8.             </column>
  9.             <column name="active" type="boolean" defaultValueBoolean="true"/>
  10.         </createTable>
  11.     </changeSet>

I export the whole database from production environment, and import it in Q&A environment, but the tablespace parameter value is not the same on both environnements. I get

  1. liquibase.exception.ValidationFailedException: Validation Failed:
  2.      1 change sets check sum
  3.           liquibase/VariableChangeLog.xml::1::bob is now: 7:0760f4ad19ac49b86d211b7c07aacec3

In my case checksum should be computed without taking into account parameter values . It it possible to do that?

Liquibase 3.4.2 on Oracle

Gérald


Re : Change set checksum and parameter substitution

Release 3.4.3?

$
0
0
Is there any chance of a 3.4.3 in the near future? I have a need for the fix to Postgresql Offline mode that was applied in January.

Thanks,
Christopher

Re : Release 3.4.3?

$
0
0
There is always a chance :)

I'm currently working on a 3.5.0 release along with a larger 4.0 refactoring, but I'll look at what has been done so far with 3.4.3 and how much longer 3.5 ends up taking.

Nathan

Missing Indentation on data load

$
0
0
I have a requirement to load groovy expressions to oracle database using liquibase. I am able to do this with loadData tag as given below. But I have a issue with groovy script indentation. After data load the groovy script indentation was missing and It causes a RunTime Exception. Please let me know how to maintain indentation while data load.

<changeSet author="build" id="v3"  runOnChange="true">
<loadData tableName="RRC"
file="changelog/v3.0/lib/rrc.dsv"
separator="|"
quotchar="~" >
</loadData>
</changeSet>

Sample rrc.dev file:
~ID~|~EXPRESSION~|~TYPE~
1|~evaluate Matched using {
// Map Group
def result = lookup "PRO_CODE", using $TABLE
if (result) {
// Use ASC Code to lookup appropriate rate, if not found line will not be priced
def rate = lookup "CODE", result.CODE using $TABLE
if (rate) {
Amount = rate.RATE
}
}
// If use default pricing
else {
Amount = Charges * $PERCENT
}
}~|~FEE_SCHEDULE

After data load the groovy expression is like below:
evaluate Matched using {
// Map Group
def result = lookup "PRO_CODE", using $TABLE
if (result) {
// Use ASC Code to lookup appropriate rate, if not found line will not be priced
def rate = lookup "CODE", result.CODE using $TABLE
if (rate) {
Amount = rate.RATE
}
}
// If Procedure Code cannot be mapped, use default pricing
else {
Amount = Charges * $PERCENT
}
}

Notification when liquidbase executes insert

$
0
0
Hi there,

I just started using liquidbase with elasticsearch in a product. 
For base data like country data hard coded in xml change files, liquidbase connects to database and puts them in place using jdbc. This solution makes it impossible to index those items in elasticsearch. In application logic, whenever a new record is being inserted, I add it to elasticsearch manually too. Because liquidbase make the inserts automatic and transparent, I can't add those items to elasticsearch. 
What I basically need is either intercepting the liquidbase so whenever an insert happens I know about it, or a notification service, or using some kind of API.
To put it together, I need to know when liquidbase executes an insert and do something at that time. What is the best and standard solution for this scenario?

Best regards 

Re : Missing Indentation on data load

$
0
0
As far as I know, groovy is not white space sensitive. What kind of white space is used for the indentation? If you are using tabs, it might work better with spaces.      

What is the nature of the exception?

Fixing this might require looking into the CSV loading code, which is not 'native' to liquibase, but is instead third party code. If I remember correctly, the library used is OpenCSV.

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

Re : Notification when liquidbase executes insert

$
0
0
Just FYI, it is Liquibase without the d in the middle - makes for better searchability if everyone uses the correct name,

I am not familiar with elasticsearch, but it seems to me that if it is dependent on the data in another database, you should come up with a solution that periodically scans the database and updates elasticsearch rather than tying your application code to two different data sources. 

If you want to alter how Liquibase works, you would need to write custom code to do that. You would probably want to look at creating your own change type that is similar to the LoadDataChange class, but that also updates elasticSearch. 

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

Re : Notification when liquidbase executes insert

$
0
0

Thanks for your response.
Indeed the big problem is how to sync the database with elasticsearch. 
Considering that data is small and liquibase may or may not do the insert based on database state, in any case I will update the elasticsearch at startup. 
But it would have been great if liquibase had offered some kind of solution for intercepting the basic operation on database.

Re : Notification when liquidbase executes insert

$
0
0
You may be one of the first people to ask for that feature. That's how open source (and indeed, just about any software) works - if no one needs a feature, it doesn't get written. The cool thing about open source is that if you see a need, you can implement it. 

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

Liquibase examples in opensource

$
0
0
Hi, 

I wounder if there are some interesting opensource projects on github that use Liquibase? 

Most preferably with some comlicated DBs: multi-schems, triggers, views, stored procedures, etc. 

Regards, 



Unexpected error running Liquibase: Must declare the scalar variable "@pBatchSize".

$
0
0
When running a sql script that is successful in ssms, I am receiving the following error when trying to run the sql file via liquibase, any ideas?

Unexpected error running Liquibase: Must declare the scalar variable "@pBatchSize".

Firebird remarks

$
0
0
I can not add comments on tables or fields using Firebird database.

Firebird: 2.5
jdbc: Jaybird-full-2.2.8
liquibase: 3.4.2
OS: Windows

PostgreSQL 9.x it works...

Example:
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog .....>
    <changeSet id="1" author="dev">
        <createTable tableName="remarks"
                     remarks="remarks of table">
            <column name="id" type="numeric(3,0)" remarks="remarks of column">
                <constraints nullable="false" />
            </column>
        </createTable>   
    </changeSet>
</databaseChangeLog>


The liquibase log not shows errors:
logLevel: debug
Computed checksum for createTable:[
    columns=[
        [
            [
                nullable="false"
            ]
            name="id"
            remarks="remarks of column"
            type="numeric(3,0)"
        ]
    ]
    remarks="remarks of table"
    tableName="remarks"
] as 7fd0f275743adef293d26b84f8aaba4d
INFO 08/03/16 16:40: liquibase: Successfully released change log lock
Liquibase Update Successful

Error: changeSet -> preConditions and tagDatabase

$
0
0
I can not use changeSet > preConditions and tagDatabase! I do not understand why not use !

<?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"
        xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
        http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
    
    <changeSet id="1" author="test">
        <preConditions onFail="MARK_RAN">
            <not><sequenceExists sequenceName="gen_test" /></not>
        </preConditions>
        
        <tagDatabase tag="v_1.0"/>
        <createSequence sequenceName="gen_test" />
    </changeSet>
</databaseChangeLog>

Re : Error: changeSet -> preConditions and tagDatabase

$
0
0
What command(s) did you use?

What did you expect to happen?

What actually happened?

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

Re : Error: changeSet -> preConditions and tagDatabase

$
0
0
What command(s) did you use?
liquibase.bat --changeLogFile=schema/latest.xml update

What did you expect to happen?
I hope to set a tagDatabase using changeSet and preconditions

What actually happened?
Unexpected error running Liquibase: Error parsing line 17 column 49 of /liquibase/schema/latest/sequences/sgrusr01_seq.xml: cvc-complex-type.2.4.a: Foi detectado um conteúdo inválido começando com o elemento 'createSequence'. Era esperado um dos '{"http://www.liquibase.org/xml/ns/dbchangelog":modifySql}'.
Viewing all 1169 articles
Browse latest View live


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