jpmsnewbie
jpmsnewbie

Reputation: 145

Is there a way to actually execute a DDL update with liquibase-maven-plugin?

I'm new to liquibase and I am wondering whether it is possible to actually execute a changeset.

update/updateSQL goal seem to simply generate a SQL file with all SQL commands (https://www.liquibase.org/documentation/maven/maven_updatesql.html)

And from other research I've learned that there's no such thing as a dry run (Liquibase - generate script without applying changesets to database / Does Liquibase support dry run?) because as indicated above, update will only create SQL scripts.

So my assumption would be that liquibase never actually executes DDL/Changes.

Please note that we're on MySQL.

Is that correct?

Upvotes: 1

Views: 1327

Answers (1)

SteveDonie
SteveDonie

Reputation: 9016

Incorrect. The update command will actually apply the changes to the database. The updateSQL is there to generate the SQL that would be applied, for use when you can't run Liquibase in a certain environment (i.e. your DBAs won't let you run Liquibase in production) or to preview the SQL before applying it.

There are some demos showing the basic workflow in the Liquibase YouTube channel.

Upvotes: 0

Related Questions