Fix error in 014 external document migration (MySQL)

Fix mysql error in migration on the unique constraint for the location column (too large).

Introduced a location_sha1 to contain a hash of the location string and test uniquness against.