Skip to content

Commit

Permalink
add release note, remote truncate
Browse files Browse the repository at this point in the history
  • Loading branch information
qqmyers committed Oct 6, 2023
1 parent e29b2b5 commit 39a2cf5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 9 additions & 0 deletions doc/release-notes/9983-unique-constraints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This release adds two missing database constraints that will assure that the externalvocabularyvalue table only has one entry for each uri and that the oaiset table only has one set for each spec. (In the very unlikely case that your existing database has duplicate entries now, install would fail. This can be checked by running

SELECT uri, count(*) FROM externalvocabularyvaluet group by uri;

and

SELECT spec, count(*) FROM oaiset group by spec;

and then removing any duplicate rows (where count>1).
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ DO $$
BEGIN

BEGIN
TRUNCATE externalvocabularyvalue
ALTER TABLE externalvocabularyvalue ADD CONSTRAINT externalvocabularvalue_uri_key UNIQUE(uri);
EXCEPTION
WHEN duplicate_table THEN RAISE NOTICE 'Table unique constraint externalvocabularvalue_uri_key already exists';
Expand Down

0 comments on commit 39a2cf5

Please sign in to comment.