Skip to content

Conversation

@vkrasnovyd
Copy link
Contributor

@vkrasnovyd vkrasnovyd commented Oct 7, 2025

Integrates changes from OpenSlides/openslides-meta#319

Current changes in the generation logic:

  • Generation with the deleted instances. Before: if the only instance of the collection is deleted and a new one is created, this new instance has sequential_number=1. Now: it has a higher value (next value from the postgres-sequence). Example: test_create_sequential_numbers_deleted_motion;
  • motion.create_forwarded: data for amendment instances is created before the data for the lead_motion. As a result, forwarded lead_motion has higher sequential_number that its amendments. Example: test_allowed_to_forward_amendments_indirectly_complex.

Other changes:

  • test_create_set_used_as_default_in_meeting_id. Reason - 1_1 trigger: now we can't have a meeting without used_as_default_projector_for_topic_in_meeting_id, so before the request we already have one.

@vkrasnovyd vkrasnovyd marked this pull request as draft October 7, 2025 17:08
@vkrasnovyd vkrasnovyd force-pushed the rel-db-sequential-numbers-cleanup branch from b680a2e to 6c6ed51 Compare October 8, 2025 09:48
@vkrasnovyd vkrasnovyd force-pushed the rel-db-sequential-numbers-cleanup branch from 676374c to da1114e Compare October 8, 2025 15:04
@vkrasnovyd vkrasnovyd marked this pull request as ready for review October 9, 2025 08:17
@vkrasnovyd vkrasnovyd requested a review from hjanott October 9, 2025 08:18
@vkrasnovyd
Copy link
Contributor Author

Check from models.yml up to permissions and jsons currently fails: regenerating models would lead to removal of the Option model and I'd prefer to deal with all these changes separately in #3167

Copy link
Member

@hjanott hjanott left a comment

Choose a reason for hiding this comment

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

To make sure that in a meeting import with sequential number models old sequences are not applied. Just use some collection and assert that an unwanted value is overwritten with the next sequence number by the database anyway.

Comment on lines +24 to +36
self.assert_model_exists(
"assignment/1",
{
"title": "test_Xcdfgee",
"meeting_id": 110,
"open_posts": 0,
"phase": "search",
"sequential_number": 1,
},
)
self.assert_model_exists(
"agenda_item/1", {"meeting_id": 110, "content_object_id": "assignment/1"}
)
Copy link
Member

Choose a reason for hiding this comment

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

Even though it's more lines, this way is so much easier to read. Love it.

@vkrasnovyd
Copy link
Contributor Author

To make sure that in a meeting import with sequential number models old sequences are not applied. Just use some collection and assert that an unwanted value is overwritten with the next sequence number by the database anyway.

Out of all the affected collections only topic and motion_workflow have the import action and sequential_number is not allowed in the payloads of both of them. Added this check to the meeting.import test for the calculated fields.

@vkrasnovyd vkrasnovyd requested a review from hjanott October 9, 2025 14:38
@vkrasnovyd
Copy link
Contributor Author

Updated the meeting.import test to check the changes from OpenSlides/openslides-meta@a1d976c

Added issue for the similar test in meta: OpenSlides/openslides-meta#336

Copy link
Member

@hjanott hjanott left a comment

Choose a reason for hiding this comment

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

Looks good. Thank you.

@hjanott hjanott assigned vkrasnovyd and unassigned hjanott Oct 29, 2025
@vkrasnovyd vkrasnovyd enabled auto-merge (squash) October 29, 2025 13:38
@vkrasnovyd vkrasnovyd disabled auto-merge October 29, 2025 14:03
vkrasnovyd added a commit to vkrasnovyd/openslides-backend that referenced this pull request Oct 30, 2025
@vkrasnovyd
Copy link
Contributor Author

Needs changes from OpenSlides/openslides-meta#343

@vkrasnovyd vkrasnovyd merged commit ab93656 into OpenSlides:feature/relational-db Nov 13, 2025
4 of 5 checks passed
@vkrasnovyd vkrasnovyd deleted the rel-db-sequential-numbers-cleanup branch November 13, 2025 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants