I am working with an add-on that does an insert into a custom member data field and I am getting the following kind of error:

A Database Error Occurred
Error Number: 1364

Field 'm_field_id_2' doesn't have a default value

My EE install is currently at 2.5.2 and it was upgraded from EE 1.6.9. In checking the exp_member_data table in database I can see that none of the custom field columns are set up with default values or allowed to be set to NULL. This includes even custom fields I set up after upgrading.

My questions are:

  1. Is it default behaviour for EE to create new exp_member_data columns to not allow NULL and to have no default set? Seems like it shouldn't be.
  2. Did something happen to my exp_member_data table in my upgrade so it is not set up correctly for EE2?
  3. Am I safe to simply set the columns in the exp_member_data table to allow NULLS and set the default value to NULL?

I have this in my fresh EE 2.5.5 install

fiedl:m_field_id_1 type:varchar(100) NULL:YES Default:

You can probably safely adjust your columns

  • This is what I ended up doing and everything seems to be working fine. I figure when I update to 2.5.5 that will update things as well. Thanks for the reply. May 9 '13 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.