diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V8.0_2023.12.05__notifyservice_table_unique_ldn_url.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V8.0_2023.12.05__notifyservice_table_unique_ldn_url.sql new file mode 100644 index 0000000000..76497df4f9 --- /dev/null +++ b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/h2/V8.0_2023.12.05__notifyservice_table_unique_ldn_url.sql @@ -0,0 +1,14 @@ +-- +-- The contents of this file are subject to the license and copyright +-- detailed in the LICENSE and NOTICE files at the root of the source +-- tree and available online at +-- +-- http://www.dspace.org/license/ +-- + +----------------------------------------------------------------------------------- +-- ADD CONSTRAINT on notifyservice table: ldn_url as unique +----------------------------------------------------------------------------------- + +ALTER TABLE notifyservice ADD CONSTRAINT ldn_url_unique UNIQUE (ldn_url); + diff --git a/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V8.0_2023.12.05__notifyservice_table_unique_ldn_url.sql b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V8.0_2023.12.05__notifyservice_table_unique_ldn_url.sql new file mode 100644 index 0000000000..76497df4f9 --- /dev/null +++ b/dspace-api/src/main/resources/org/dspace/storage/rdbms/sqlmigration/postgres/V8.0_2023.12.05__notifyservice_table_unique_ldn_url.sql @@ -0,0 +1,14 @@ +-- +-- The contents of this file are subject to the license and copyright +-- detailed in the LICENSE and NOTICE files at the root of the source +-- tree and available online at +-- +-- http://www.dspace.org/license/ +-- + +----------------------------------------------------------------------------------- +-- ADD CONSTRAINT on notifyservice table: ldn_url as unique +----------------------------------------------------------------------------------- + +ALTER TABLE notifyservice ADD CONSTRAINT ldn_url_unique UNIQUE (ldn_url); + diff --git a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/NotifyServiceRestRepository.java b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/NotifyServiceRestRepository.java index 8c9bc579c1..3671b05498 100644 --- a/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/NotifyServiceRestRepository.java +++ b/dspace-server-webapp/src/main/java/org/dspace/app/rest/repository/NotifyServiceRestRepository.java @@ -106,6 +106,11 @@ public class NotifyServiceRestRepository extends DSpaceRestRepository