Mike Nishizawa
Mike Nishizawa

Reputation: 2052

What is the recommended way to manage updates to views in liquibase?

I am currently managing views through liquibase as sql files. The problem I have is, in order to produce updates to those views, I have to create new versions of the view as files, which defeats the purpose of putting them in version control in the first place. What is the recommended way to get around this? Or is there a recommended way?

Upvotes: 1

Views: 1663

Answers (1)

ronak
ronak

Reputation: 646

There is a replaceIfExists attribute on createView that will replace an existing view.

http://www.liquibase.org/documentation/changes/create_view.html

A strategy would be then to define the view in your changeset, and just update with a new changeset. There is probably better but your changelog would be stored in source so it possible see when a changeset got added.

Upvotes: 1

Related Questions