How to update Metadata without new version (in DB) - BEXIS2/Core GitHub Wiki
Update Metadata without new version
- 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>%'