There was no mysqlCreateReferenceConstraint so it was
referring to the base class which threw a horrible assert.
I have created the constraint stuff in the style of the
NOTE: The PG version could easily create constraint
name duplicates. This is a nono in mysql and other
databases. I have modified the naming convention so
that they're far less likely to clash.