[mysq]: generation of constraints for reference fields