I have some SQL scripts that I’d like to convert into Liquibase XML changelogs. Is this possible?
Question posted in PostgreSQL
The official documentation can be found here.
The official documentation can be found here.
I have some SQL scripts that I’d like to convert into Liquibase XML changelogs. Is this possible?
2
Answers
What exactly do you mean by "convert into changelogs"?
If you don’t need cross-database compatibility, you could just use the
sql
executor:The
splitStatements=false
setting will make sure the complete SQL will be sent in one command; otherwise, Liquibase would split it into multiple commands at semicolons.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. You will have the XML changelog generated for all the SQL scripts you have applied to your database.
Alternatively, have a look at answer on this SO post.