Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions scripts/database/upgrades/upgrade_v4.8.6_to_v4.9.sql
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,11 @@ ALTER TABLE dvobject DROP COLUMN doiseparator;

--Add new setting into content for shoulder
INSERT INTO setting(name, content)
VALUES (':Shoulder', (SELECT substring(content, strpos(content,'/')+1) || '/' from setting where name = ':Authority'));
SELECT ':Shoulder', substring(content, strpos(content,'/')+1) || '/' from setting where name = ':Authority' and strpos(content,'/')>0;

--strip shoulder from authority setting
UPDATE setting
SET content=(SELECT substring(content from 0 for strpos(content,'/'))
FROM setting
WHERE name=':Authority' and strpos(content,'/')>0) where name=':Authority';
--strip shoulder from authority setting if the shoulder exists
UPDATE setting
SET content= case when (strpos(content,'/')>0) then substring(content from 0 for strpos(content,'/'))
else content end where name=':Authority';

update datasetfieldtype set displayformat = '<a href="#VALUE" target="_blank">#VALUE</a>' where name in ('alternativeURL', 'keywordVocabularyURI', 'topicClassVocabURI', 'publicationURL', 'producerURL', 'distributorURL');