Columns should be ordered according to their length because this is better for mysql. Please move the type column before the code column