-
Notifications
You must be signed in to change notification settings - Fork 492
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
sql script/flyway to fix file access requests #11061
base: develop
Are you sure you want to change the base?
sql script/flyway to fix file access requests #11061
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
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.
The update script looks good. Just wondering if you considered putting on a DB constraint as Jim suggested.
AND far2.authenticated_user_id = fileaccessrequests.authenticated_user_id | ||
AND far2.request_state is NULL); | ||
|
||
UPDATE fileaccessrequests SET request_state='CREATED' WHERE request_state is NULL; |
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.
Did you consider putting a DB constraint on as Jim suggested?
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.
@qqmyers Could you add your suggestion here please?
Never mind. I see it in the Issue
📦 Pushed preview images as
🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
What this PR does / why we need it: To prevent duplicate keys when user requests access to a file
Which issue(s) this PR closes: #10714
Special notes for your reviewer:
Suggestions on how to test this: Create a database before updating to this code. Add dataset with multiple files (restricted) and publish the dataset. From another user request access multiple times for multiple files. Manually delete the "Created" from the request_state UPDATE fileaccessrequests SET request_state=NULL;
Update Dataverse with this code and re-deploy. You should see any duplicate requests deleted from the database (oldest will remain for each file/user). Once updated the database will have only one request for each file/user and the UI will show "Access Requested"
Does this PR introduce a user interface change? If mockups are available, please link/include them here: No
Is there a release notes update needed for this change?: Included
Additional documentation: