Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions collections/history_entry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ fields:
entries:
type: text[]
restriction_mode: A
structured_information:
type: JSON
restriction_mode: A
original_model_id:
type: string
restriction_mode: A
Expand All @@ -19,17 +16,15 @@ fields:
to:
collections:
- assignment
- meeting_user
- motion
- poll
- topic
- user
field: history_entry_ids
restriction_mode: A
reference:
- assignment
- meeting_user
- motion
- poll
- topic
- user
position_id:
type: relation
Expand Down
16 changes: 6 additions & 10 deletions collections/meeting_user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,22 @@ fields:
restriction_mode: A
poll_option_ids:
type: relation-list
to: poll_option/meeting_user_id
reference: poll_option
required: false
to: poll_option/content_object_id
on_delete: PROTECT
restriction_mode: A
acting_ballot_ids:
type: relation-list
to: poll_ballot_user/acting_meeting_user_id
on_delete: SET_NULL
restriction_mode: A
represented_ballot_ids:
type: relation-list
to: poll_ballot_user/represented_meeting_user_id
on_delete: SET_NULL
restriction_mode: A
# on_delete: CASCADE
entitled_at_poll_ids:
poll_entitled_user_ids:
type: relation-list
to: poll/entitled_meeting_user_ids
to: poll_entitled_user/meeting_user_id
restriction_mode: A
chat_message_ids:
type: relation-list
Expand All @@ -117,7 +117,3 @@ fields:
equal_fields: meeting_id
restriction_mode: A
to: structure_level/meeting_user_ids
history_entry_ids:
type: relation-list
to: history_entry/model_id
restriction_mode: A
10 changes: 3 additions & 7 deletions collections/poll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ fields:
to: group/poll_ids
equal_fields: meeting_id
restriction_mode: A
entitled_meeting_user_ids:
entitled_user_ids:
type: relation-list
to: meeting_user/entitled_at_poll_ids
equal_fields: meeting_id
to: poll_entitled_user/poll_id
on_delete: CASCADE
restriction_mode: A
projection_ids:
type: relation-list
Expand All @@ -131,7 +131,3 @@ fields:
restriction_mode: A
required: true
constant: true
history_entry_ids:
type: relation-list
to: history_entry/model_id
restriction_mode: A
4 changes: 2 additions & 2 deletions collections/poll_ballot_user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ fields:
type: relation
reference: meeting_user
to: meeting_user/acting_ballot_ids
required: true
required: false
restriction_mode: A
represented_meeting_user_id:
type: relation
reference: meeting_user
to: meeting_user/represented_ballot_ids
required: true
required: false
restriction_mode: A
18 changes: 18 additions & 0 deletions collections/poll_entitled_user.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
fields:
id:
type: number
restriction_mode: A
constant: true
required: true
poll_id:
type: relation
to: poll/entitled_user_ids
reference: poll
required: true
restriction_mode: A
meeting_user_id:
type: relation
to: meeting_user/poll_entitled_user_ids
reference: meeting_user
required: false
restriction_mode: A
14 changes: 10 additions & 4 deletions collections/poll_option.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ fields:
text:
type: string
restriction_mode: A
meeting_user_id:
type: relation
to: meeting_user/poll_option_ids
reference: meeting_user
content_object_id:
type: generic-relation
reference:
- meeting_user
- user
Comment on lines +19 to +23

@vkrasnovyd vkrasnovyd Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  1. During migration: if meeting_user exists, use it, if not - use user.
  2. On meeting_user delete - change relation to user.
  3. On meeting_user create if user has poll_options in the polls of the corresponding meeting - don't change content_object_id from user to the new meeting_user.

Is it correct?

@bastianjoel bastianjoel Aug 26, 2026 •

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.

  1. You can just always use the user if it is easier.

to:
collections:
- meeting_user
- user
field: poll_option_ids
required: false
restriction_mode: A
4 changes: 4 additions & 0 deletions collections/topic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ fields:
required: true
restriction_mode: A
constant: true
history_entry_ids:
type: relation-list
to: history_entry/model_id
restriction_mode: A
4 changes: 4 additions & 0 deletions collections/user.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ fields:
to: committee/native_user_ids
restriction_mode: E
reference: committee
poll_option_ids:
type: relation-list
to: poll_option/content_object_id
restriction_mode: A
history_position_ids:
type: relation-list
to: history_position/user_id
Expand Down
149 changes: 76 additions & 73 deletions dev/sql/schema_relational.sql

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dev/src/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ def check_field(
if type in RELATION_TYPES:
valid_attributes.append("on_delete")
if "on_delete" in field and field["on_delete"] not in (
"SET_NULL",
"CASCADE",
"PROTECT",
):
Expand Down
Loading