BigQuery: Rename Relationships
An existing relationship can be renamed as follows:
- Console
- API
- Head to
Data -> [table-name] -> Relationships
in the Console - Drop the existing relationship
- Recreate the relationship with the new name
You can rename a relationship by using the bigquery_rename_relationship metadata API:
POST /v1/metadata HTTP/1.1
Content-Type: application/json
X-Hasura-Role: admin
{
"type": "bigquery_rename_relationship",
"args": {
"source": "<db_name>",
"dataset": "bigquery",
"table": "articles",
"name": "article_details",
"new_name": "article_detail"
}
}
Note
You might not be allowed to drop a relationship if it has been referenced elsewhere (e.g. in a permissions rule).
In this case you will have to delete the references first, rename the relationship, and then re-add the references.