Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

generateChangelog is destructive by default #2

Closed
stevesaliman opened this Issue · 3 comments

2 participants

@stevesaliman
Collaborator

The default behavior of the generateChangelog task is to append to changelog files if they currently exist.

I feel like this is a contradiction of http://www.liquibase.org/manual/command_line and https://github.com/tlberglund/groovy-liquibase/blob/master/howto.md which both state that generateChangelog should write to stdout.

It gets more interesting when there are multiple changelogs defined in the build.gradle file. GenerateChangelog writes to all the files mentioned in the changelogs section with identical data.

Thanks,

Steve

@tlberglund
Owner

Thanks for posting this, Steve. I don't like the append behavior at all. Liquibase itself handles XML appending with a little bit of string manipulation (or something similar—I don't remember precisely) which is not available to me here. What would you say to having the plugin just fail if the changelog already exists? I think I prefer this behavior anyway. I've always thought of generateChangeLog as a bootstrapping command, such that appending isn't really meaningful. We have diff commands for that.

@stevesaliman
Collaborator

I agree. If you've got a project that already has a changelog, especially more than one, it means you've already plugged your project into the Liquibase universe. Appending to a changelog would be kind of meaningless at best, and at worst it would really confuse things with multiple changesets trying to do the same thing.

Failing if the changelog exists is a good way to tell the user "hey, this has already been done"

@stevesaliman stevesaliman was assigned
@stevesaliman
Collaborator

This is now fixed in 1.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.