Skip to content

Add migration for trigger naming scheme change - #3853

Merged
luisa-beerboom merged 15 commits into
OpenSlides:feature/dammifrom
luisa-beerboom:add-migration-for-trigger-naming-scheme-change
Nov 13, 2026
Merged

luisa-beerboom merged 15 commits into
OpenSlides:feature/dammifrom
luisa-beerboom:add-migration-for-trigger-naming-scheme-change

Conversation

@luisa-beerboom

@luisa-beerboom luisa-beerboom commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Closes #3704 (by performing the change necessary according to this comment)

Needs OpenSlides/openslides-meta#629

Adds a migration, which drops all triggers and creates all of them anew (Prerequisite for database migrations, because the triggers were renamed for newer instances, while older ones (present at introduction of relDB) use an older naming scheme).
Migration also handles log trigger changes for OpenSlides/openslides-go#336 (by sneakily creating the two new pairs of triggers along with recreating the old ones)

@luisa-beerboom luisa-beerboom linked an issue Nov 11, 2026 that may be closed by this pull request
@luisa-beerboom luisa-beerboom linked an issue Nov 11, 2026 that may be closed by this pull request
@luisa-beerboom
luisa-beerboom marked this pull request as ready for review November 11, 2026 15:44
@luisa-beerboom luisa-beerboom assigned vkrasnovyd and unassigned hjanott Nov 11, 2026
@luisa-beerboom
luisa-beerboom requested review from hjanott and vkrasnovyd and removed request for hjanott November 11, 2026 16:04
@luisa-beerboom

Copy link
Copy Markdown
Member Author

See this comment

This'll have to wait for a moment longer and the diff will need to change again

@luisa-beerboom

Copy link
Copy Markdown
Member Author

See this comment

This'll have to wait for a moment longer and the diff will need to change again

All done

@hjanott hjanott 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.

Currently I don't see that the trigger name change is already implemented. Please create a meta PR for that too. The issue for that is #3568 especially. #3568 (comment)

@hjanott hjanott removed their assignment Nov 12, 2026
@luisa-beerboom

Copy link
Copy Markdown
Member Author

Added changes to trigger names as demanded in #3568 (comment)

Didn't work on the rest of the issue

@hjanott hjanott assigned luisa-beerboom and unassigned hjanott Nov 13, 2026
@luisa-beerboom
luisa-beerboom enabled auto-merge (squash) November 13, 2026 15:37
@luisa-beerboom
luisa-beerboom merged commit 2f39745 into OpenSlides:feature/dammi Nov 13, 2026
5 checks passed
luisa-beerboom added a commit that referenced this pull request Nov 17, 2026
* Sql diff generator (#3625)

* [dammi] Remove mig tables (#3641)

* apply sql diff
* change base test
* cleanup get_stats/count method
* improve exception stats output
* handle listdir patching in migrate_previous
* fix create_schema
* implement new directory structure for migration module and schema_diff
* add migration_number to basemigtestcase
* remove finalization states and add migration finished state
* decuple BaseMigration and BaseMigrationRouteTestCase
* remove finalize command
* use only empty values within replace tables
* fix followup errors due to failing tests and continuing migration thread
* deactivate notify triggers during migration and reactivate on reset
* Move copy table to migration helper.
* improve exception handling

* [dammi]Add data preparation step and reimplement reset route (#3660)

* use deprecated  model registry (#3662)

* improve schema diff file handling (#3669)

* improve migration lookup (#3671)

* [Dammi] Split off version table writing for migrations (#3643)

* [dammi] More ground work for sql diff (#3679)

 * improve file handling
 * generate whole new collections
 * more constraint cases and new function for altered fields
 * Handle remove and rename tree
 * safely access GenerateCodeBlocks variables

* [dammi] Remove deferred (#3687)

* [dammi] view diff generation (#3699)

 * centralize models variables
 * collect alter_views conditionally and recreate in the end
 * extract get_view_field_state_write_fields
 * debug main functions with make test-file
 * improve variable names and reuse code in cli util
 * centralize and restructure RENAME

---------

Co-authored-by: Viktoriia Krasnovyd <114735598+vkrasnovyd@users.noreply.github.com>

* [dammi] reintroduce migrations subfolder (#3708)

* [dammi] Handle remove (#3686)

* [dammi] rename triggers, constraints, indexes and field enums (#3711)

* generate from CodeBlocks call

* centralize code block information

* implement rename inline constraints and other constraints and triggers

 * move rename code to RenameHelper

* [dammi] Remove secondary_edits (#3736)

* [dammi] sql diff edit part (#3729)

* [dammi] Sql diff edit: equal fields, constant, max, min and minLength (#3773)

* edit case generate equal fields and restructure EqualFieldsHelper a bit
* sqlfluffing output + sorting 
* handle min, max, minLength, unique, constant
* recreate renamed intermediate table and respect that in equal fields generation

---------

Co-authored-by: luisa-beerboom <101706784+luisa-beerboom@users.noreply.github.com>

* [dammi] Handle edit for meta enums (#3791)

* handle edit for meta enums
* handle remove field case correctly
* rename enum right way around
* drop enum default if existed
* respect changes from meta enum to field based enum and reverse
* respect items
* rename meta enums
* drop and recreate view

* [Dammi] Add handling (#3748)

* Fix RemoveHelper (#3816)

* handle reference
* remove calculated field from diff control
* delete fk and idx just cascadingly

* Fix stuff in dammi (#3820)

* Fix equal fields removal

* Fix trigger generation for relation field adding

* Fixes for DaMMi (#3824)

* Fix more dammi stuff (#3823)

* Fix case new enum constraint

* Implement generic relation expansions

* Fix even more dammi stuff (#3826)

* Fix not remove field trigger generation

* Alter field types when changing global enums

* Drop triggers before changing type to enum, return them after (#3842)

* Add new consultation sequence enabling setting (#3843)

* Add migration for trigger naming scheme change (#3853)

* Add migration for trigger naming scheme change

* Also handle missing log triggers in user-committee calc relation

* Always apply the new settings default in migration 102

* Fix flaky migration tests

* Add changes for fix of generated array field log triggers

* Make changes for trigger names

* Update test_0100_init_reldb.py

---------

Co-authored-by: luisa-beerboom <101706784+luisa-beerboom@users.noreply.github.com>
Co-authored-by: Viktoriia Krasnovyd <114735598+vkrasnovyd@users.noreply.github.com>
Co-authored-by: vkrasnovyd <viktoriia.krasnovyd@intevation.de>
Co-authored-by: Luisa <luisa.beerboom@intevation.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug migration Introduces a new migration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consultation sequence: new setting

3 participants