liquibase / liquibase-groovy-dsl

The official Groovy DSL for Liquibase
Other
83 stars 34 forks source link

How can I load extensions #33

Closed amexboy closed 5 years ago

amexboy commented 6 years ago

Hi

I see the examples has loadData, but liquibase complains 'loadData' is not a valid element of a ChangeSet

How can load extensions?

stevesaliman commented 6 years ago

loadData is part of the Liquibase core, so you shouldn't need to load any extensions. How are you using loadData in your change set? It requires a map and a closure. If one of them is missing, you'd get an error like the one you are seeing. Here is an example of a valid loadData element:

changeSet (id: 'myChangeSet', author: 'me') {
  loadData(file: 'data.csv', tableName: 'myTable') {
    column(name: 'id')
    column(name: 'description')
  }
}
amexboy commented 6 years ago

@stevesaliman I didn't know the closure was required. Even an empty closure works.

The xml counter part takes identityInsertEnabled?

amexboy commented 6 years ago

@stevesaliman identityInsertEnabled is part of an extension (liquibase-mssql). I couldn't figure out how to load that. I even tried to create a new extension, but it is not being detected, any clue?

amexboy commented 6 years ago

@stevesaliman I just figured out that the groovy-dsl doesn't detect extensions and I made my modifications to enable that.

https://github.com/liquibase/liquibase-groovy-dsl/pull/36

Sent a pull request

stevesaliman commented 5 years ago

I just released version 2.0.2 of the Groovy DSL with the changes that allow extension provided changes to be loaded. Thank you for all of your help on this issue.

amexboy commented 5 years ago

Glad I could help.

Amanuel Nega (Software Engineer)

On Sun, Nov 4, 2018 at 9:59 PM Steven C. Saliman notifications@github.com wrote:

Closed #33 https://github.com/liquibase/liquibase-groovy-dsl/issues/33.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/liquibase/liquibase-groovy-dsl/issues/33#event-1944961668, or mute the thread https://github.com/notifications/unsubscribe-auth/AG_trj8SsZiAxQ1UoWSttPfijdqEGc3pks5urzkKgaJpZM4WWO-m .