Skip to content

How to delete a Metadata version (in DB)

Franziska Zander edited this page Mar 21, 2021 · 2 revisions

Delete Metadata version

  1. Important: Only delete versions, if they are not yet used (e.g. DOI) or linked (e.g. externally distributed link)!!!
  2. Important: Do not change or delete directly in the database without a current backup!
  3. Important: Keep in mind deleting a version changes the current version number.
  4. Important: Dueto some cached values in NHibernate session it can be necessary to restart the Server (Application pool)

Latest version

  • check, if the version is linked.
    • Yes: Change existing links to the previous version.
    • No: no action required

Table datasetversions

  • Filter by dataset ID: SELECT * FROM public.datasetversions WHERE datasetref = '2349' ORDER BY id
  • Delete newest version
  • Set status of the new newest version to 2
  • Check result in dataset view

Older Version

  • check, if the version is linked.
    • Yes: Change existing links to another version
    • No: no action required
  • check, if the version number is automatically set in the metadata
    • Yes: Kep in mind the change the number in all newer versions
    • No: no action required

Table datasetversions

  • Filter by dataset ID: SELECT * FROM public.datasetversions WHERE datasetref = '2349' ORDER BY id
  • Delete version
    • Error can not be deleted: check where it is linked and if it can be deleted (.e.g linked in contentdescriptors)
  • Check result in dataset view
Clone this wiki locally