我使用的是Grails 2.1.1和MySQL 5.5.27 Community Server。Grails GORM MySQL生成TEXT或LONGTEXT列
我需要一个Domain类字段生成一个TEXT或LONGTEXT列。
我想这将是简单的,和我见过很多例子:
不过,我碰到的死角,整个晚上。我遵循所有这些例子,似乎没有任何工作(尽管其他人已经报道它的工作原理)。
这里是一个示例域类我创建:
class Coltest {
static constraints = {
description1 sqlType: 'longtext'
description2 sqlType: 'text'
description3 type: 'text'
description4 column: "longDescription", type: "text", nullable:true
}
String description1
String description2
String description3
String description4
}
以下是我在MySQL命令界面获得:
mysql> describe coltest;
+--------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |