Skip to content

Fix meeting_id not filled in ballot#504

Closed
bastianjoel wants to merge 3 commits into
OpenSlides:feature/votefrom
bastianjoel:fix-meeting-id
Closed

Fix meeting_id not filled in ballot#504
bastianjoel wants to merge 3 commits into
OpenSlides:feature/votefrom
bastianjoel:fix-meeting-id

Conversation

@bastianjoel

@bastianjoel bastianjoel commented Apr 24, 2026

Copy link
Copy Markdown
Member

Meeting id now needs to be added to ballot because of the newly added equalfields constraints.

Go downgraded to align with other services.

@bastianjoel bastianjoel requested a review from ostcar April 24, 2026 11:42
@bastianjoel bastianjoel self-assigned this Apr 24, 2026
Comment thread go.mod
@bastianjoel

bastianjoel commented Apr 29, 2026

Copy link
Copy Markdown
Member Author

When finalizing a secret approval poll I get following error:
Error: bulk inserting anonymized ballots: ERROR: null value in column "meeting_id" of relation "ballot_t" violates not-null constraint (SQLSTATE 23502)

@ostcar

ostcar commented May 3, 2026

Copy link
Copy Markdown
Member

I don't get the constrain. I don't see, that the vote logic needs this field. Why does the DB?

@bastianjoel

Copy link
Copy Markdown
Member Author

ballot.yaml:

  poll_id:
    type: relation
    reference: poll
    to: poll/ballot_ids
    equal_fields: meeting_id
    required: true
    restriction_mode: A
    constant: true

Because of the equal_fields: meeting_id

@ostcar

ostcar commented May 4, 2026

Copy link
Copy Markdown
Member

Could we remove that? I don't see, why we need this constrain? See also OpenSlides/openslides-meta#498

@ostcar ostcar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please explain to me first, why the meeting_ids field in the ballot collection is necessary

@bastianjoel

Copy link
Copy Markdown
Member Author

Yes, removing that constraint would work too.

@bastianjoel

Copy link
Copy Markdown
Member Author

Not needed anymore OpenSlides/openslides-meta#500

@bastianjoel bastianjoel closed this May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants