Skip to content

Commit

Permalink
Fix duplicate names for Salesforce custom fields
Browse files Browse the repository at this point in the history
  • Loading branch information
paveltiunov committed Sep 10, 2018
1 parent f283bd2 commit dfc5b22
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion target_postgres/db_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def column_type(schema_property):


def inflect_column_name(name):
return inflection.underscore(re.sub(r"([A-Z]+)_([A-Z][a-z])", r'\1__\2', name))
name = re.sub(r"([A-Z]+)_([A-Z][a-z])", r'\1__\2', name)
name = re.sub(r"([a-z\d])_([A-Z])", r'\1__\2', name)
return inflection.underscore(name)


def safe_column_name(name):
Expand Down

0 comments on commit dfc5b22

Please sign in to comment.