-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11061 from IQSS/10714-access-requests-missing-sin…
…ce-upgrade-v6-0 sql script/flyway to fix file access requests
- Loading branch information
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
doc/release-notes/10714-access-requests-missing-since-upgrade-v6-0.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
### Flyway Script added to Fix File Access Requests when upgrading from Dataverse 6.0 | ||
|
||
Database update script added to prevent duplicate keys when upgrading from V6.0 | ||
This script will delete access requests made after the initial request and will set the initial request to "Created" | ||
|
||
See: https://github.com/IQSS/dataverse/issues/10714 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- Fixes File Access Requests when upgrading from Dataverse 6.0 | ||
-- See: https://github.com/IQSS/dataverse/issues/10714 | ||
DELETE FROM fileaccessrequests | ||
WHERE creation_time <> (SELECT MIN(creation_time) | ||
FROM fileaccessrequests far2 | ||
WHERE far2.datafile_id = fileaccessrequests.datafile_id | ||
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; |