docs: def _migrate_conversations():  # noqa
      """
      Due to issue #28 (https://github.com/juju-solutions/charms.reactive/issues/28),
      conversations needed to be updated to be namespaced per relation ID for SERVICE
      and UNIT scope.  To ensure backwards compatibility, this updates all convs in
      the old format to the new.
  
      TODO: Remove in 2.0.0
      """
      for key, data in unitdata.kv().getrange('reactive.conversations.').items():
          if 'local-data' in key:
              continue
          if 'namespace' in data:
              continue
          relation_name = data.pop('relation_name')
          if data['scope'] == scopes.GLOBAL:
              data['namespace'] = relation_name
              unitdata.kv().set(key, data)
          else:
              # split the conv based on the relation ID
              new_keys = []
              for rel_id in hookenv.relation_ids(relation_name):
                  new_key = Conversation._key(rel_id, data['scope'])
                  new_units = set(hookenv.related_units(rel_id)) & set(data['units'])
                  if new_units:
                      unitdata.kv().set(new_key, {
                          'namespace': rel_id,
                          'scope': data['scope'],
                          'units': sorted(new_units),
                      })
                      new_keys.append(new_key)
              unitdata.kv().unset(key)
              # update the states pointing to the old conv key to point to the
              # (potentially multiple) new key(s)
              for flag in get_flags():
                  value = _get_flag_value(flag)
                  if not value:
                      continue
                  if key not in value['conversations']:
                      continue
                  value['conversations'].remove(key)
                  value['conversations'].extend(new_keys)
                  set_flag(flag, value)