Hi guys,
I am using MySQL, and I'm having difficulty increasing the size of the products_model field in the products table. I need to increase it because the varchar max limit is only 255 (or 256, i forget), and that's not big enough for my needs. I need 510 atleast.
I have tried dropping the table then creating it again with the field as
> `products_model` text(510) default NULL,
and leaving in the original key setting line
> KEY `idx_products_model_zen` (`products_model`),
and i also tried as a blob type but i get this error for both
> BLOB/TEXT column 'products_model' used in key specification without a key length.
because the field is used as a key i suppose. It works ok as long as i don't set it as a key, but it's probably needed since it's been set up that way.
I know the field also exists in the table orders_products, though i don't know why as it would seem redundant to have it in both to me. Anyway, my plan was to change this field too once i had changed the one in the products table. In the meantime I don't see why this would be causing any referential integrity problems and so inhibit me changing the other table.
Does anyone know the syntax for setting the key with a length in the table creation SQL, as the error message implies? Or any other way i can achieve this?
My fingers are crossed as these forums have been seriously helpful on previous occasions.
All the best!
Bod


Reply With Quote

