Unable to increase length of one of the fields in the database table

ChrisNetmo

New Member
Hi,

I have created a couple custom fields, in order to save the full value I'll have to increase the field:

value varchar 255
in
mw_list_field_value

to something larger like 10000 or maybe 20000 (I'm using 5.7.x which support varchar up to 65,535 chars)

However if I tried to change the length to something like VARCHAR 20000 I got the following error message:

MySQL said: Specified key was too long; max key length is 3072 bytes

if I try to use a different type other than varchar (ie. BLOB / TEXT) I'll get the following error instead

MySQL said: BLOB/TEXT column 'value' used in key specification without a key length

Just wondering if there is any workaround solution.

Please advise.
 
This is because that field is indexed, so if you want to increase it, you also have to drop the index on the value column, then do a partial index on only 3072 bytes instead of the whole field.

Keep in mind, if you do this, you'll also need to change the code in a few places to allow more than 200 chars, since the validation rules are very strict in this area and only accept that maximum length.
 
Back
Top