liquibase - derby and postgresql question

Hi


I’m new to liquibase and i try to get it working ;-).


Introduction:

I have a environment where developer can choose between derby (javadb) and postgreSQL. The deployment server runs on postgreSQL. Our App uses JPA/Hibernate with envers for auditing.


What is did first was: 


  • Generated the db.changelog from existing postgreSQL database.


That worked and i got a xml file with all the tables.  Here a example:


  1.  
  2.         
  3.             
  4.         
  5.         
  6.         
  7.         
  8.             
  9.         
  10.         
  11.             
  12.         
  13.         
  14.         
  15.             
  16.         
  17.         
  18.             
  19.         
  20.         
  21.         
  22.         
  23.         
  24.         
  25.             
  26.         
  27.     


But when i tried to setup a derby db, i got the problems with int8, when i generate from Derby, i get BIGINT. 


I was thinking, that the generated XML File should be “database independent”? Did i make a error with generating the xml file?


  1. set CLASSPATH=%HOMEPATH%.m2 epositoryorgglassfishextrasglassfish-embedded-all3.0glassfish-embedded-all-3.0.jar;%HOMEPATH%postgresql-8.4-701.jdbc4.jar
  2. if "%LIQUIBASE_HOME%"=="" set LIQUIBASE_HOME=C:programmejavaliquibase-2.0.1
  3. if not exist "%LIQUIBASE_HOME%" echo LIQUIBASE_HOME not defind && goto end
  4. set CHANGELOGFILE=c: empinit.db.aud.changelog.xml
  5. echo Write to %CHANGELOGFILE%
  6. %LIQUIBASE_HOME%liquibase --classpath "%CLASSPATH%" --driver=org.postgresql.Driver  --defaultSchemaName=fzk --changeLogFile=%CHANGELOGFILE% --url="jdbc:postgresql://localhost:5432/fzkdb" --username=fzkuser --password=fzkpwd generateChangeLog
  7. :end


Any idea what i did wrong?


Thanks a lot

Currently, when you generate a changelog, it uses  the data type in the database verbatim.  For many datatypes, they are portable across databases (like varchar) but you end up with int8 sometimes as well.  For liquibase 2.1 we are going to look at improving diff support, possibly converting from specific datatypes to more generic before building the chagneset, but for now you will have to do a search and replace to go from a your postgres-specific changelog to a generic changelog that will work on derby as well.


Nathan