def _add_pid_to_chain(chain_model, pid):
    chain_member_model = d1_gmn.app.models.ChainMember(
        chain=chain_model, pid=d1_gmn.app.did.get_or_create_did(pid)
    )
    chain_member_model.save()