db: add Postgres function to generate soft-deleted repository name
Created by: unknwon
We currently have two places construct soft-deleted repository name when soft-deleting a repository, and soon will have third place (in my WIP PR).
Therefore, I think it is better to factor out this part as a Postgres function.