Swap integer and bigint columns for notes and dependent tables for self-managed

This is the next step after Initialize the migration of notes.id and depend... (#389306 - closed). The process is outlined here.

These columns were already swapped for GitLab.com with #392815 (closed), now we have to do it for self-managed instances.

The columns we need to migrate are

Edited by Krasimir Angelov