fixing has_through for all database types