Better fix for not picking up foreign keys in other databases on MySQL
Better fix for not picking up foreign keys in other databases on MySQL

@opts[:database] can be nil on do and jdbc, and can be incorrect
if a USE statement is used, so use the DATABASE() function to get
the currently connected database.

dennis-d/custom_sequel,freshpay/sequel,offshore-safety/sequel,reubano/sequel,mpalmer/sequel,gferguson-gd/sequel,offshore-safety/sequel,t-morgan/sequel,uhoh-itsmaciek/sequel,uhoh-itsmaciek/sequel,nju520/sequel,nicohvi/sequel,gferguson-gd/sequel,nju520/sequel,offshore-safety/sequel,Marketcircle/sequel,yazshel/sequel,reubano/sequel,mpalmer/sequel,davidbegin/sequel,yazshel/sequel,bigfix/sequel,nicohvi/sequel,davidbegin/sequel,dennis-d/custom_sequel,freshpay/sequel,t-morgan/sequel,seeARMS/sequel,seeARMS/sequel,pfarrell/sequel,knut2/sequel,beni55/sequel,knut2/sequel,pfarrell/sequel,chef/sequel,beni55/sequel