Logic for when to include schema name on foreign keys incorrect. Should only include catalogName and schemaName when they are different than the default