`SELECT count(*) FROM sys.foreign_keys as F inner join sys.tables as T on F.parent_object_id=T.object_id inner join information_schema.tables as I on I.TABLE_NAME = T.name WHERE F.name = ? AND T.Name = ? AND I.TABLE_CATALOG = ?;`,
name,stmt.Table,m.CurrentDatabase(),
).Row().Scan(&count)
})
returncount>0
}
func(mMigrator)CurrentDatabase()(namestring){
m.DB.Raw("SELECT DB_NAME() AS [Current Database]").Row().Scan(&name)