gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 08:51:50 24 4
gpt4 key购买 nike

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

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 (用于图片),我认为这可能会导致“行大小太大”问题。顺便说一下,我使用的是 grails 2.0.0。我该如何解决这个问题?

该应用程序在本地运行良好,没有抛出此错误,这就是为什么我看到它时感到非常震惊。

最佳答案

您可以在 their website 上阅读有关 MySQL 中的此硬限制的信息。 。基本上,您有太多 256 和 4000 个字符的列,以至于超出了 65,535 的限制。最好的做法是将 varchar(4000) 列切换为 text:

class MyDomain {
String description

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

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

关于mysql 错误 :ERROR hbm2ddl. SchemaUpdate - 将 Grails 应用程序推送到 Cloud Foundry 时行大小太大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10969978/

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