-
Notifications
You must be signed in to change notification settings - Fork 15
How to update Metadata without new version (in DB)
Franziska Zander edited this page Mar 8, 2021
·
1 revision
- Important: Do not change or delete directly in the database without a current backup!
- Important: Only use this way of update, if you do not change the content. This would require to create a new version
Table datasetversions
- Select / Copy content of metadata from one representative data set version.
- Open and format (e.g. in Visual Studio Code).
- Extract identical string to be replaced
- Example (replace restricted by Restricted):
update datasetversions
set metadata = Replace(metadata::text, '<DataAccessPolicy type="MetadataAttribute" name="DataAccessPolicy" roleId="184" id="225" number="1">restricted</DataAccessPolicy>', '<DataAccessPolicy type="MetadataAttribute" name="DataAccessPolicy" roleId="184" id="225" number="1">Restricted</DataAccessPolicy>')::xml
where metadata::text ilike '%<DataAccessPolicy type="MetadataAttribute" name="DataAccessPolicy" roleId="184" id="225" number="1">restricted</DataAccessPolicy>%'