Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include xml changelogs is impossible #14

Closed
vporoxnenko opened this issue Feb 9, 2016 · 6 comments
Closed

include xml changelogs is impossible #14

vporoxnenko opened this issue Feb 9, 2016 · 6 comments

Comments

@vporoxnenko
Copy link

it's currently impossible to include xml changelog files due to in-code restrictions

databaseChangeLog() {
include(file: 'sequences.changelog.xml', relative: true)
include(file: 'tables.changelog.xml', relative: true)
......
}

liquibase.exception.SetupException: DatabaseChangeLog: 'relative' is not a supported attribute of the 'include' element

it's required to use includeAll method instead, but this method includes only groovy file, and I need xml in my project

@stevesaliman
Copy link
Collaborator

I think that xml files might actually work, since Liquibase natively knows how to deal with XML files.

The problem here is probably that your change is using relative instead of relativeToChangelogFile...

@vporoxnenko
Copy link
Author

I'm calling xml from groovy dsl, so it goes via groovy wrapper

see
org.liquibase.groovy.delegate.LegacyDatabaseChangeLogDelegate

void include(Map params = [:]) {
if ( params.containsKey('path') ) {
throw new ChangeLogParseException("Error: the 'include' element
no longer supports the 'path' attribute. Please use the 'includeAll'
element instead.")
}

  // validate parameters.
  def unsupportedKeys = params.keySet() - ['file',

'relativeToChangelogFile']
if ( unsupportedKeys.size() > 0 ) {
throw new ChangeLogParseException("DatabaseChangeLog:
'${unsupportedKeys.toArray()[0]}' is not a supported attribute of the
'include' element.")
}....

it throw errors, but why?

2016-02-11 5:05 GMT+03:00 Steven C. Saliman notifications@github.com:

I think that xml files might actually work, since Liquibase natively knows
how to deal with XML files.

The problem here is probably that your change is using relative instead
of relativeToChangelogFile...


Reply to this email directly or view it on GitHub
#14 (comment)
.

Regards,
Valentin A. Poroxnenko

@stevesaliman
Copy link
Collaborator

path is not supported by the include change, but file is. What happens if your changelog looks like this:

databaseChangeLog() {
  include(file: 'sequences.changelog.xml', relativeToChangelogFile: true)
  include(file: 'tables.changelog.xml', relativeToChangelogFile: true)
......
}

@vporoxnenko
Copy link
Author

it's work
seems the problem was caused by stupid cut and paste

@stevesaliman
Copy link
Collaborator

I like to call that "edit time inheritance" :-)

Glad it's working for you now.

@vporoxnenko
Copy link
Author

thanks

2016-02-15 18:02 GMT+03:00 Steven C. Saliman notifications@github.com:

I like to call that "edit time inheritance" :-)

Glad it's working for you now.


Reply to this email directly or view it on GitHub
#14 (comment)
.

Regards,
Valentin A. Poroxnenko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants