Reputation: 3531
I was able to deploy successfully to Cloud Foundry last time and now that new domain classes are getting introduced, I need to update it. It updated successfully, but then one table was not created, which is why I tried to delete the app and push it again to see the error in detail and this is what I got:
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.
Just to give a little background about the domain, it contain 3 longblobs (for pictures) and I'm thinking that that might cause the "Row size too large
" problem. By the way, I'm using grails 2.0.0. How do I resolve this?
The app works fine locally, it did not throw this error, that's why I was very shocked when I saw it.
Upvotes: 0
Views: 1043
Reputation: 4492
You can read about this hard limit in MySQL on their website. Basically, you have so many 256 and 4000 character columns that you have gone over the 65,535 limit. Your best course of action is to switch the varchar(4000)
columns to text
:
class MyDomain {
String description
static mapping = {
description type: "text"
}
}
Be aware though that Hibernate may not be able to migrate your existing data to the new column type. Test it first! And be sure to back up your CF database before updating it.
Upvotes: 2