Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query on old contextids #277

Merged
merged 6 commits into from
Dec 4, 2024
Merged

Query on old contextids #277

merged 6 commits into from
Dec 4, 2024

Conversation

gunnarvelle
Copy link
Member

Legger til liste med alle gamle contextids for en node.

@gunnarvelle gunnarvelle marked this pull request as ready for review December 3, 2024 07:28
@gunnarvelle gunnarvelle requested a review from a team December 3, 2024 07:29
@gunnarvelle
Copy link
Member Author

Fungerte overraskende bra. Testa lokalt å fjerne en plassering for en artikkel og dermed en kontekst og fikk denne sida:
image

Comment on lines +1595 to +1596
SELECT json_agg(obj->>'contextId')
FROM jsonb_array_elements(contexts) AS obj
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vet ikke om jeg forstår koden helt ennå så ikke skyt meg om dette er dumt 😄

Dette betyr at vi henter contextids fra en annen kolonne på samme rad sant?

Hvorfor kan vi ikke bare bruke node.getContexts().map(ctx -> ctx.getId()) eller laget en helper på node for å gjøre det? Vil vel ikke koste stort mer ytelse og da slipper vi å holde dataen i sync?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heile poenget er at vi må ha en liste med kontekstider som ikkje lenger er i lista med kontekster. For at vi skal kunne hente noder basert på gamle kontekster, som den nye testmetoden viser.

@gunnarvelle gunnarvelle merged commit 2264c03 into master Dec 4, 2024
3 checks passed
@gunnarvelle gunnarvelle deleted the query-on-old-contextids branch December 4, 2024 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants