From 45171e5f15e077e0dcd475f439736b236b96787e Mon Sep 17 00:00:00 2001 From: bohlski Date: Fri, 17 Jun 2022 13:20:37 +0200 Subject: [PATCH] Added UNIQUE constraint on actor_name as suggested in issue. --- .../src/main/resources/sql/derby/auditContributorDBCreation.sql | 2 +- .../main/resources/sql/postgres/auditContributorDBCreation.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bitrepository-service/src/main/resources/sql/derby/auditContributorDBCreation.sql b/bitrepository-service/src/main/resources/sql/derby/auditContributorDBCreation.sql index 523ca6c80..03d28f908 100644 --- a/bitrepository-service/src/main/resources/sql/derby/auditContributorDBCreation.sql +++ b/bitrepository-service/src/main/resources/sql/derby/auditContributorDBCreation.sql @@ -65,7 +65,7 @@ create index fileindex on file ( fileid, collectionid ); create table actor ( actor_guid bigint not null generated always as identity primary key, -- The guid for the actor. - actor_name varchar(255) -- The name of the actor. + actor_name varchar(255) unique -- The name of the actor. ); create index actorindex on actor ( actor_name ); diff --git a/bitrepository-service/src/main/resources/sql/postgres/auditContributorDBCreation.sql b/bitrepository-service/src/main/resources/sql/postgres/auditContributorDBCreation.sql index 50af7dd6e..55bf9a713 100644 --- a/bitrepository-service/src/main/resources/sql/postgres/auditContributorDBCreation.sql +++ b/bitrepository-service/src/main/resources/sql/postgres/auditContributorDBCreation.sql @@ -61,7 +61,7 @@ CREATE INDEX fileindex ON file ( fileid, collectionid ); --*************************************************************************-- CREATE TABLE actor ( actor_guid SERIAL PRIMARY KEY, -- The guid for the actor. - actor_name VARCHAR(255) -- The name of the actor. + actor_name VARCHAR(255) UNIQUE -- The name of the actor. ); CREATE INDEX actorindex ON actor ( actor_name );