Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to convert SQL queries to liquibase changelog format?

I would like to know if it is possible to convert an existing SQL script into XML format of changelogs of a liquibase?

like image 990
Belham Avatar asked Nov 12 '18 16:11

Belham


People also ask

How do I run a .SQL file in Liquibase?

To run the execute-sql command, specify the following parameters in the Liquibase properties file, environment variables, or the command prompt while running the command: URL, driver [optional], and user authentication information such as username and password.

What is Liquibase formatted SQL?

Liquibase (LB) is an open source tool written in Java. It makes defining database changes easy, in a format that's familiar and comfortable to each user. Then, it automatically generates database-specific SQL for you. Database changes (every change is called changeset) are managed in files called changelogs.

Can you convert SQL to XML?

With SQL Server Management Studio, you can save your SQL database as CSV and then you can convert the database files to XML, PDF or other formats as you like.


1 Answers

You could use a detour via a database. Apply your script to a database of choice (that is supported by liquibase). Then use generateChangeLog to generate the changelogs in xml from the database.

like image 72
Jens Avatar answered Sep 29 '22 10:09

Jens