Skip to content

Migration for OpenFullMax and MaxWidth#1103

Closed
donaldgray wants to merge 3 commits intodevelopfrom
feature/replace_maxunauth
Closed

Migration for OpenFullMax and MaxWidth#1103
donaldgray wants to merge 3 commits intodevelopfrom
feature/replace_maxunauth

Conversation

@donaldgray
Copy link
Copy Markdown
Member

@donaldgray donaldgray commented Feb 5, 2026

These 2 values will supersede MaxUnauthorised so migration contains UPDATE script for setting new fields appropriately.

PR contains migration only - these are not used in application. UPDATE statement based on https://github.com/dlcs/protagonist/blob/develop/docs/adr/0010-replace-maxunauthorised.md#use-case--behaviours

Below shows a table of the different permutations of MaxUnauthorised/Role and how they are transformed to OpenFullMax/Role (MaxWidth will be null in all instances). Note that the "classification" value is from update statement:

asset max_unauthorised original_roles open_full_max new_roles classification
max_minus_no_role -1 0 all
max_minus_role -1 https://whatever 0 https://whatever need-role
max_zero_no_role 0 0 https://dlcs.io/roles/unobtainable none
max_zero_role 0 https://whatever 0 https://whatever need-role
max_val_no_role 2000 2000 https://dlcs.io/roles/unobtainable full-only
max_val_role 2000 https://whatever 2000 https://whatever zoom-with-role

Warning

Contains a migration. New columns in "Images" and UPDATE statement.
This could be slow / expensive in some environments!

Resolves #1092

@donaldgray donaldgray requested a review from tomcrane February 5, 2026 16:43
@donaldgray donaldgray requested a review from a team as a code owner February 5, 2026 16:43
Comment thread compose/docker-compose.db.yml
Comment thread src/protagonist/DLCS.Model/Assets/Asset.cs
These 2 values will supersede MaxUnauthorised so migration contains
UPDATE script for setting new fields appropriately.
Remove and re-add as there was a migration introduced to dev. Also
changed to use not-null integer values for consistency and ease of
implementing API (for historical reasons the logic assumes there are no
null values so implemmentation is simplified if this is the case)
@donaldgray donaldgray force-pushed the feature/replace_maxunauth branch from bf503aa to 02f4673 Compare February 10, 2026 12:18
@donaldgray
Copy link
Copy Markdown
Member Author

Closing PR - the change to make maxWidth and openFullMax has broken a large number of tests that will be fixed in follow up PR when API can handle new columns. Will update bring these changes into that PR

@donaldgray donaldgray closed this Feb 10, 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.

Allow maxWidth + openFullMax to be set per asset - Database

2 participants