-
Notifications
You must be signed in to change notification settings - Fork 97
Drop RDMRecordQuota.user_id
unique constraint
#2037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drop RDMRecordQuota.user_id
unique constraint
#2037
Conversation
RDMRecordQuota.user_id
unique constraint
e1f382f
to
729730f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM and good to merge/release.
@utnapischtim in theory this would be a major bump. Installing this version wouldn't break anything though and it's just a matter of running the Alembic recipe to apply the fix. Thus I think it would be fine to just release a patch.
* this seems to have been a copy-paste error, or similar * previously it was only possible to create an `RDMRecordQuota` for a single record per user due to this constraint
* previously, the quota setting logic only ran as part of `Record.create()` which is executed by the service before any service components are run * since the ownership information is set in a dedicated service component, this caused the `get_files_quota()` function to never pick up the appropriate `RDMUserQuota` for new drafts * so now we set the quota in a service component as well, to be run after the `AccessComponent`
I've rebased and removed the |
As discussed in Discord, this unique constraint prevents the creation of
RDMRecordQuota
s for several records per user and was likely just a copy-paste error from somewhere else.In the Zenodo DB, this constraint was dropped already.
This PR chases that change.
ℹ️ for convenience reasons, i've also added a fix for the user quota not being respected to this PR (which took over as primary discussion point)
Given that v13 is scheduled to come out in just a few days (around 90), we'll just keep it a v13-only feature and add this to the list of known issues in v12.
Edit: Documentation update is here: inveniosoftware/docs-invenio-rdm#763