简体   繁体   English

Grails:如果更改会影响域表的架构,如何更改插件域类?

[英]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. 我将一个String字段的maxSize约束从255更改为8000。

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. 您应该将更改记录为插件升级说明的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM