database: insert repo_permission if missing for unrestricted
Created by: keegancsmith
The bitbucket explicit permission API uses the SetRepoPermissionsUnrestricted call to mark a repository as unrestricted. However, this silently did nothing unless we already had permissions in the repo_permissions table.
This commit updates the query from an UPDATE to an UPSERT.
The are only two call sites to this API. Both are from explicit repository permission APIs. So this fixes a bug for both calls.
Test Plan: Manually tested the bitbucket API by setting a project as unrestricted. Users could then see it. Additionally updated the unit tests.