Fix sort by hits

* Postgres requires NULLS LAST on an ORDER DESC, apparently
* We can get away with the GROUP BY primary key trick for the rest
Fix HitsMappingsRelations import

* Straight mySQL -> postgreSQL swap
* INSERT IGNORE simulation and ANSI update style