I have a table products
where the column code
is a TINYTEXT
.
When trying to create a foreign key ( FOREING KEY
) I get this error:
# 1170 - Column BLOB column 'code' used in key specification without key size
Since you can not create foreign keys using fields tinytext
( among others ), I decided to convert the column code
to VARCHAR
, but, to correctly define the length of VARCHAR
I need to know:
How many characters does the longest code saved in the table have?