mysql错误:错误hbm2ddl.SchemaUpdate-将Grails应用程序推送到Cloud Foundry时,行大小太大

mysql错误:错误hbm2ddl.SchemaUpdate-将Grails应用程序推送到Cloud Foundry时,行大小太大,mysql,grails,cloud,cloud-foundry,Mysql,Grails,Cloud,Cloud Foundry,我上次能够成功地部署到CloudFoundry,现在新的域类正在引入,我需要更新它。它已成功更新,但没有创建一个表,这就是为什么我尝试删除该应用程序并再次推送它以查看详细错误的原因,这就是我得到的结果: ERROR hbm2ddl.SchemaUpdate - Unsuccessful: create table case_file (id bigint not null auto_increment, version bigint not null, case_type varchar(25

我上次能够成功地部署到CloudFoundry,现在新的域类正在引入,我需要更新它。它已成功更新,但没有创建一个表,这就是为什么我尝试删除该应用程序并再次推送它以查看详细错误的原因,这就是我得到的结果:

ERROR hbm2ddl.SchemaUpdate  - Unsuccessful: create table case_file (id bigint not null auto_increment, version bigint not null, case_type varchar(255) not null, category varchar(255) not null, client_id bigint not null, date_created datetime not null, class varchar(255) not null, has_criminal_record bit, house_size decimal(19,2), number_of_children integer, agreement varchar(255), brief_evaluation varchar(4000), comments varchar(4000), court_order varchar(255), date_from datetime, date_of_birth datetime, date_of_report datetime, date_signed_authorized_person datetime, date_signed_revisor datetime, date_to datetime, demand_number varchar(255), first_name varchar(255), has_court_order bit, has_intervention_plan bit, has_voluntary_measures bit, interventions_measure_and_resources varchar(4000), last_name varchar(255), other_documents varchar(255), permanent_code varchar(255), proposed_orientation varchar(4000), results_obtained varchar(4000), signature_of_authorized_person longblob, signature_of_director_of_social_services longblob, signature_of_revisor longblob, situation_of_child varchar(4000), voluntary varchar(255), primary key (id)) ENGINE=InnoDB
2012-06-10 15:17:02,466 [main] ERROR hbm2ddl.SchemaUpdate  - Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
2012-06-10 15:17:02,501 [main] ERROR hbm2ddl.SchemaUpdate  - Unsuccessful: alter table case_file add index FK27F9B12B94D36A39 (client_id), add constraint FK27F9B12B94D36A39 foreign key (client_id) references client (id)
2012-06-10 15:17:02,501 [main] ERROR hbm2ddl.SchemaUpdate  - Table 'd838abcc25b974c87a204aa924e607694.case_file' doesn't exist
2012-06-10 15:17:13,997 [main] ERROR util.JDBCExceptionReporter  - Table 'd838abcc25b974c87a204aa924e607694.case_file' doesn't exist
Stopping Tomcat because the context stopped.
为了给大家介绍一下这个域的背景,它包含3个长blob(用于图片),我认为这可能会导致“
行大小太大”
”的问题。顺便说一下,我正在使用Grails2.0.0。我如何解决这个问题


这个应用程序在本地运行得很好,它没有抛出这个错误,这就是为什么当我看到它时我非常震惊的原因

你可以在MySQL上读到这个硬限制。基本上,您有256和4000个字符的列,超过了65535的限制。最好的做法是将
varchar(4000)
列切换到
text

class MyDomain {
    String description

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

请注意,Hibernate可能无法将现有数据迁移到新的列类型。先测试一下!在更新CF数据库之前,请确保对其进行备份。

我明白了。。我确实降低了平均时间的限制。我要试试看D