gpt4 book ai didi

mysql - mysql 的 maxSize 为 25000 的 grails 2.3.1 问题

转载 作者:行者123 更新时间:2023-11-30 23:00:27 25 4
gpt4 key购买 nike

我得到一个奇怪的行为,将约束应用于我的域类中的字符串文本:

class MyClass {
String field

static constraints = {
field nullable: true, maxSize: 25000
}
}

将 25000 的 maxSize 应用到我的字段时,我从控制台收到以下错误:

Column length too big for column 'promo_text' (max = 21845); use BLOB or TEXT instead

更改 maxSize 解决了我的问题,但为什么 GORM 没有自动转换它?

我可以在哪里举报?

斯奈特

最佳答案

如果你不想设置最大尺寸那么你可以使用type: "text", like

class MyClass {
String field

static constraints = {
field nullable: true
}

static mapping = {
field type: "text"
}
}

关于mysql - mysql 的 maxSize 为 25000 的 grails 2.3.1 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24312600/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com