Skip to content

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

Open
hjanott wants to merge 6 commits into
OpenSlides:feature/dammifrom
hjanott:sql_diff_edit_equal_fields
Open

hjanott wants to merge 6 commits into
OpenSlides:feature/dammifrom
hjanott:sql_diff_edit_equal_fields

Conversation

@hjanott

@hjanott hjanott commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

This adds the ability to edit equal fields.
For convenience reasons added constant and max min constraint generation also.
Also recreates renamed intermediate tables since these were necessary to be excluded for drop during equal fields recreation.

@hjanott hjanott added this to the 4.4 milestone Sep 21, 2026
@hjanott hjanott self-assigned this Sep 21, 2026
@hjanott
hjanott force-pushed the sql_diff_edit_equal_fields branch from 036548b to 176a2e6 Compare September 22, 2026 15:24

@vkrasnovyd vkrasnovyd left a comment

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.

It's impressive how much you've simplified the equal fields helper while adding more logic to it.



def get_schema_sql_dict() -> dict[str, dict[str, str]]:
def get_schema_sql_dict() -> dict[str, dict[str, Any]]:

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.

Did the type really change? If no, please return a more narrow type definition.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In the case of triggers the type can also be of dict[str, dict[str, str]] instead of str since it is nesting arround field and trigger group also. That's why I chose Any.

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.

str | dict[str, dict[str, str]] would cover this case too without making type definition too wide.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I will create a type like this.
TriggerSqlDict = dict[str, dict[str, dict[str, str]]]
mypy wouldn't accept it like you suggested which seems bugged to me.

@hjanott hjanott assigned luisa-beerboom and unassigned hjanott Sep 29, 2026
@hjanott hjanott changed the title Sql diff edit equal fields [dammi] Sql diff edit: equal fields, constant, max, min and minLength Sep 29, 2026
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.

3 participants