0

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

sakhunzai
  • 13,900
  • 23
  • 98
  • 159

1 Answers1

0

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.

Mirko Adari
  • 5,083
  • 1
  • 15
  • 23
  • thanks @Mirko Adari , I tried sth with with xslt[http://stackoverflow.com/questions/14379447/xslt-change-override-attribute-on-copy-of-not-applied-using-saxon/14379957#14379957].This splits out the changelots out to individual files but I am unable to fetch the triggers/procedure and functions. I am looking forward to do sth with xslt and ODBC connectivity. Cheers – sakhunzai Jan 21 '13 at 07:31