Fix instance url_name creation migration

This migration failed when the instance table contained more than 1 row.
I fixed it by creating the unique instance after generating the url_name
values.