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

Re : Use Liquidbase to create objects in empty database

$
0
0
Sorry you hadn't gotten a response.

The thing to remember about organizing your changesets is that in the end they get flattened into a list and ran from top to button, and order can matter. Just like it is usually best to add changeSets to the end of a changelog, you normally only want to be adding to the "last" nested changelog in the flattened list. 

It can work to have independent changelogs by feature or by component, but only if the database objects in those files are completely independent. If there is overlap and references between them, it will cause problems down the road.

Normally my suggestion is to break up changelogs by release. Have a 1.1.xml, 1.2.xml, 1.3.xml file etc. That generally gives manageable sized files and automatically has you working on the end of the flattened list. If you end up going back to a fixpack on an earlier version, adding to the earlier changelog usually works just fine because since the change won't depend on anything in later versions.

Nathan

Re : preCondition onFail="CONTINUE"

$
0
0
The reason is because preconditions on child changelogs are considered global to the entire changelog. There is a feature request in jira to support preconditions that cause the changelog it is in to be skipped, but the current functionality is that if a changelog has a top level precondition it is checked before anything is run, even changeSets in other changelogs.

Nathan

Re : Generated duplicate constraint names

$
0
0
The primary key name liquibase uses should be what hibernate is generating. Is there a limit on PK length in hiberante that is causing the conflicts?

Nathan

Re : Execute an Oracle sql script

$
0
0
The reason it is closed is because liquibase is just calling out to the executable and has no control over whether the executable exits or not.   

I tested with the 3.2.1 release (almost released, but should be the same as 3.2.0) with a changeset of:

  1.  <changeSet author="Uri" id="1" runAlways="true">
  2.         <executeCommand executable="C:\oracle\sqlplus.exe">
  3.             <arg value="lbuser/lbuser"/>
  4.             <arg value="@c:\\temp\a.sql"/>
  5.         </executeCommand>
  6.     </changeSet>

and an a.sql file of 

  1. select current_timestamp from dual;
  2. /
  3. exit;
  4. /
and it exited correctly for me. You may need to ensure you have a newline after the trailing /

Nathan

Re : How to reference new change in xml file

$
0
0
You probably just need to make sure you have a namespace for your new change. If you don't want to create you own xsd, you can use 


A full header like:


  1.     <changeSet id="1" author="me">
  2.         <ext:myChange attribute1="x"/>
  3.     </changeSet>

Nathan

Re : Liquibase generateChangeLog is failing - with Table already exists

$
0
0
The problem is probably because of differences in the "filename" of the changelog. Each changeSet is uniquely identified with the id+author+filename. If you select * from databasechangelog you will see what the current values are. 

I'm not sure how you and/or jhipster handles paths, but it is usually best to use classpath-relative paths for your changelogs so they are independent of the machine they run on. I would guess yours got stored as absolute and now they are different.

Depending on your environment, you can just update the databasechangelog table, or you can fix how you are referencing your changelog files, or you can use the logicalFilePath attribute to hard code the compared filename.

Nathan

Re : How to tag a database with liquibase 3.2.0 ?

$
0
0
The null pointer exception should be fixed in the upcoming 3.2.1 release.

Nathan

Re : Upgrading from 2.0.5 to 3.2.0 - Problem with preConditions ?

$
0
0
It seems to be working fine for me with the 3.2.1 version I am in final testing with. Try it with that version when it is out and let me know if you are still having problems.

Nathan

Re : GenerateChangeLog + Oracle column order for tables (v3.1.1)

$
0
0
Yes, that has now been fixed with the upcoming 3.2.1 release.

Nathan

Re : precondition problem mysql

$
0
0
It is working for me on 3.2.1. Can you try the newest version? (3.2.1 should be out later today or monday)

Nathan

Re : mysql tagDatabase operation problem

Re : Export data from db2 database

$
0
0
Unfortunately there is not support yet for excluding certain tables from the export. You will have to export everything and then delete from the generated changelog.

Nathan

Re : ignoredTables maven example

$
0
0
It hasn't been incorporated yet. Hopefully with 3.3.0.

Nathan

Re : CURRENT_TIMESTAMP with mariadb

$
0
0
Hi,

I didn't even know there was a specific driver for mariadb. I was using the official mysql jdbc driver. I do not know if it make any difference.

I'm moving my scripts from mysql to mariadb and I wan't to retain what I have.

I'm using mariadb 10.0.12 and the default value for TIMESTAMP is CURRENT_TIMESTAMP by default
  1. [fsousa@imac ~]$ mysql
  2. Welcome to the MariaDB monitor.  Commands end with ; or \g.
  3. Your MariaDB connection id is 17
  4. Server version: 10.0.12-MariaDB Homebrew

  5. Copyright (c) 2000, 2014, Oracle, SkySQL Ab and others.

  6. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

  7. MariaDB [(none)]> create database test;
  8. Query OK, 1 row affected (0.00 sec)

  9. MariaDB [(none)]> use test;
  10. Database changed
  11. MariaDB [test]> CREATE TABLE t (id INT, ts TIMESTAMP);
  12. Query OK, 0 rows affected (0.02 sec)

  13. MariaDB [test]> desc t
  14.     -> ;
  15. +-------+-----------+------+-----+-------------------+-----------------------------+
  16. | Field | Type      | Null | Key | Default           | Extra                       |
  17. +-------+-----------+------+-----+-------------------+-----------------------------+
  18. | id    | int(11)   | YES  |     | NULL              |                             |
  19. | ts    | timestamp | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
  20. +-------+-----------+------+-----+-------------------+-----------------------------+
  21. 2 rows in set (0.00 sec)

  22. MariaDB [test]>


--diffTypes="tables" is an unexpected command parameter

$
0
0
I run liquibase diff on command:
liquibase --driver=com.mysql.jdbc.Driver --url=jdbc:mysql://192.168.2.242:3306/test --classpath=/data/mysql-connector-java-5.1.22.jar --username=root --password=biker diffchangelog --referenceUrl=jdbc:mysql://192.168.2.242:3306/koala --referenceUsername=biker --referencePassword=biker --diffTypes="data"

but there is an error happened:
Error:unexpected command parameter: --diffTypes=data

why?

Re : --diffTypes="tables" is an unexpected command parameter

Re : Upgrading from 2.0.5 to 3.2.0 - Problem with preConditions ?

$
0
0
Thanks Nathan! I will try it when 3.2.1 is out and I will let you know if i have any problem.

Re : Upgrading from 2.0.5 to 3.2.0 - Problem with preConditions ?

Referring to s for

$
0
0
LB 3.1.1
 
In the interest of DRY, Don't Repeat Yourself, I tried referring to a changeSet from a previous release of our application for a rollback of a modification made this release.  Upon running the next update, I got a SAXException from XMLChangeLogSAXHandler:336 because it couldn't find the changeset I was referring to.  This makes sense because we always feed only the changeSets from the most recent release into Liquibase when performing an update (We do have an install routine that feeds every known change into LB for empty schemas).  We do this to prevent LB from having to parse files from several old releases that aren't going to contain any new changes.  We also do it as a safety measure to avoid surprises from maintenance branch merges.  My strategy was that upon rollback, I would let LB see all the changes so that it could refer to any of them.
 
db-module/v1_3_2/db.changelog.xml  <-- changeset modifying XYZ_VIEW is here
db-module/v1_3_3/db.changelog.xml  <-- Another changeset modifying XYZ_VIEW, wanting to use the changeset above for <rollback>
db-module/install.xml <-- Includes all previous releases in order and supporting files (constants, hack to set session current_schema, runAlways stuff)
db-module/update.xml <-- Includes only most recent release and supporting files
 
when we run liquibase update, we only show it the 1.3.3 file, and it fails.  I understand wanting to parse the changelog in a manner that is independent of the task it's going to be used for.  Which is why XMLChangeLogSAXHandler is trying to make sure it's well-formed. 
 
Clearly I'm using this in an unintended manner.  What do others do?  Am I being too paranoid about not putting all of the previous releases in Liquibase's sight when doing incremental updates?

Re : --diffTypes="tables" is an unexpected command parameter

Viewing all 2993 articles
Browse latest View live


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