I’m using the optimized MySQL Server Docker images, created, maintained and supported by the MySQL team at Oracle.For clarity I chose MySQL 8.0.15 for the check constraint hack and obviously 8.0.16 for the “real” check constraint implementation.

I did not mention that the hack works as well in 8.0.16, though not needed anymore.

CHECK constraint is another useful feature implemented in MySQL (and not the last one, stay tuned!). There are some other interesting things to know about this feature but also about the others available in MySQL 8.0.16. Please have a look on the references below.