From 58999f5102a6028be2c4d9617d46e93e3970f7e0 Mon Sep 17 00:00:00 2001 From: Steve Chavez Date: Wed, 6 Mar 2024 20:21:58 -0500 Subject: [PATCH] changelog: add how to detect o2o rels on v10.0.0 (#3312) --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04c248f3d..d99466b37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -384,6 +384,11 @@ This project adheres to [Semantic Versioning](http://semver.org/). - #2312, Using `Prefer: return=representation` no longer returns a `Location` header - @laurenceisla - #1984, For the cases where one to one relationships are detected, json objects will be returned instead of json arrays of length 1 + If you wish to override this behavior, you can use computed relationships to return arrays again + + You can get the newly detected one-to-one relationships by using the `--dump-schema` option and filtering with [jq](https://github.com/jqlang/jq). + ``` + ./postgrest --dump-schema \ + | jq '[.dbRelationships | .[] | .[1] | .[] | select(.relCardinality.tag == "O2O" and .relFTableIsView == false and .relTableIsView == false) | del(.relFTableIsView,.relTableIsView,.tag,.relIsSelf)]' + ``` ## [9.0.1] - 2022-06-03