Fix the upgrade migration of custom profile fields in #2545

The upgrade_2-1_postgresql.sql changes are untested, but do match the changes to upgrade_2-1_mysql.sql that are tested and confirmed to fix the upgrade issues in #2545.

Signed-off-by: Noteworthy Software, Inc <online@noteworthysoftware.com>
If this is removed, the query to pull the IM fields, location and gender will fail if those columns aren't there. That's specifically why we have that check there.