Length 2 for YEAR columns is not supported by MySQL 8 and not really useful for
older versions either:
https://dev.mysql.com/doc/refman/8.0/en/year.html
> MySQL 8.0 does not support the 2-digit YEAR(2) data type permitted in older
> versions of MySQL. For instructions on converting to 4-digit YEAR, see
> 2-Digit YEAR(2) Limitations and Migrating to 4-Digit YEAR, in MySQL 5.7
> Reference Manual.
*/
protected function validateLength($length)
{
- if ($length !== 2 && $length !== 4) {
- throw new \InvalidArgumentException("Only '2' and '4' are valid lengths for year columns");
+ if ($length !== 4) {
+ throw new \InvalidArgumentException("Only '4' is a valid length for year columns.");
}
}
}