Fixed mysql foreign key failure

I had some issues while running migrations on InnoDB tables with foreign key checks. This fixed it for me.