def METHOD_NAME(inspector, table: str, name_dict):
    """Rename the forign keys.
    Bit of extra logic is needed becuase the table might not get changed.
    But the referencing table might get a name change and it might be referenced in the FK name.
    ie org_type_code_fkey is a foriegn key on org which refers to org_type table.
    when org_type is turned into org_types ,fk is also changed
    """
    foreign_keys = inspector.get_foreign_keys(table)
    for fk in foreign_keys:
        fk_name = fk.get('name')
        referred_table = fk.get('referred_table')
        referred_table_new_name = name_dict.get(referred_table, '')
        if referred_table_new_name:
            new_fk_name = fk_name.replace(referred_table, referred_table_new_name)
            if fk_name != new_fk_name:
                op.execute(f'ALTER table "{table}" RENAME CONSTRAINT {fk_name} TO {new_fk_name}')