1

I would like to use liquibase for db versioning.

I face a kind of problem. I would like to know how to do for commiting changes I make directly on the database to the db.changelog.xml.

I tried the command generateChangeLog but it append the script to create the complete database one after the other. I would like to have only the changes between an old db.changelog.xml and the database.

I saw that people use a reference database, I find that very heavy and not very flexible and scalable for doing a good continuous integration.

Is there any other solution to simply compare the differences bewteen a db.changelog.xml and a database and write them in this db.changelog.xml ?

Thanks.

enorniel
  • 31
  • 1
  • 3
  • In any case, if it is not possible, what are the minimum privileges to give to databases for making a diff with liquibase ? – enorniel Oct 08 '13 at 15:43

1 Answers1

1

I guess that is not how liquibase is intended to be used. You should do all your changes through liquibase changesets and let liquibase handle db updates. If you additionally also change the db manually it will get tough to handle this.

There is no real support for this in liquibase (imho). You can only try to come up with a solution yourself by using the generateChangeLog command and then compare the result to an existing other changelog file.

I think the intention of the generateChangeLog is to use it at the start of a project when you already have an existing db and you want to switch over to use liquibase. But not to constantly use this to overcome manual changes that have been done without liquibase.

Jens
  • 6,243
  • 1
  • 49
  • 79
  • Thanks. In that case, is there any other opensource system to do db versioning without the needs to write queries in another thing than the sql db itself ? – enorniel Oct 09 '13 at 15:19
  • I took example on that tutorial to do what I want: http://www.sitepoint.com/versioning-your-database-with-liquibase/ but it seems that datas are not diffed (only schema). What are commands to also diff datas ? thanks. – enorniel Oct 10 '13 at 08:47
  • I guess there are many tools out there that diff between data bases or synchronize data bases (even the data in it). Here is a [question](http://stackoverflow.com/questions/225772/compare-two-mysql-databases) for mysql but the answers also include recommendations for general db diff tools. You should maybe create another question if you are looking for tools to do this. Or even better research it yourself and ask specific questions here on SO. – Jens Oct 10 '13 at 11:23