Question

I am trying to add the liquibase tool into my development environment to manage database migrations. Given the feature set it looks very flexible and promising. My first obvious question is how I can export all the existing schema into individual files (tables, triggers, functions and stored procedures ). ?

Is there any tool/extension for liquibase to perform such task.

I have tried command line option liquibase generateChangelogs , but unfortunately it generates single changelog file ( without stored objects -fun/pro/trig)

anything using bash/java/any linux standard xml processing command line tool is appreciable

Here is what I want to do : -Have xml templates for mysql function/stored procedure /trigger/table etc

  • query existing database for all tables/function triggers etc.. go through each and parse respective template and generate changelog file for each object

  • -- store each file in respective director under current location e.g

    /database

     ---/functions
    
     ---/procedures
    
     ---/triggers
    
     ---/views
    
     ---/tables
    

thanks

Was it helpful?

Solution

This is not possible, but you can generate the initial changelog with the command and then write a script that separates the objects. Afterwards just create a master changelog that includes the others.

Check my post on Liquibase ( http://scalabilitycookbook.com/2012/10/05/control-your-database-schema/ ) for details.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top