Search code examples
grailsgrails-ormgrails-2.0grails-domain-class

Grails: How do I make changes to a plugins domain class if the change affects the schema of the domain's table?


I have a plugin used by different projects and I found out that I need to make a change in one domain class. How do I make sure that the schema is properly updated in the projects that depend on my plugin?

Update:

I'm changing maxSize constraint of one String field from 255 to 8000.


Solution

  • How do I make sure that the schema is properly updated in the projects that depend on my plugin?

    You really can't, at least not in a way that is generally applicable. In general a plugin should not assume that the application is generating or modifying schema. You should document the change as part of your plugin's upgrade notes.