Skip to content

Unpublish Dataset: Create an API endpoint to unpublish a dataset  #4895

@kcondon

Description

@kcondon

We need an API endpoint to unpublish datasets in some cases where a user may mistakenly publish their dataset in root when it needs to be reviewed first in by a journal dataverse.

Here are the essential steps by hand that hopefully will become the endpoint:

Tables involved:
Dataset
Datasetlock
Datasetversion
Dvobject

To Unpublish a Dataset:

  1. Lock dataset
    insert into datasetlock (reason, starttime, dataset_id, user_id) values ('InReview', now(), 3092, 7);
  2. (N/A) Reset DOIs to reserved, both dataset and files
    log on to ezid console, manage dois, set dois from public to unavailable
    Not really needed: would resolve to need perms link and works again once published.
  3. Change datasetversion table: releasetime, versionstate, versionnumber, minorversionnumber
    update datasetversion set versionstate='DRAFT', releasetime=NULL, versionnumber=NULL, minorversionnumber=NULL where dataset_id=3092 and id=98;
  4. Change dvobject table for dataset: publicationdate, globalidcreatetime
  5. (N/A) Change dvobject table for datafiles: same as for dataset
    update dvobject set publicationdate=NULL, globalidcreatetime=NULL where id in (3093, 3094, 3095);
    Not really needed, no functional impact and ezid has original create time stored.
  6. Change dataset table: lastexporttime
    update dataset set lastexporttime=NULL where id=3092;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    SPRINT READY

    Status

    Interested

    Status

    ⚠️ Needed/Important

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions