PR#1159: enforce unique content generator names in database
Merges #1159 https://pagure.io/koji/pull-request/1159 Fixes: 1668 enforce unique content generator names in database https://pagure.io/koji/issue/1668
This commit is contained in:
commit
23cd44b5e0
2 changed files with 5 additions and 1 deletions
|
|
@ -77,4 +77,8 @@ INSERT INTO user_krb_principals ( SELECT id, krb_principal FROM users WHERE user
|
|||
|
||||
ALTER TABLE users DROP COLUMN krb_principal;
|
||||
|
||||
-- Disallow duplicate content generator names
|
||||
ALTER TABLE content_generator ADD UNIQUE (name);
|
||||
ALTER TABLE content_generator ALTER COLUMN name SET NOT NULL;
|
||||
|
||||
COMMIT;
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ INSERT INTO volume (id, name) VALUES (0, 'DEFAULT');
|
|||
-- data for content generators
|
||||
CREATE TABLE content_generator (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name TEXT
|
||||
name TEXT UNIQUE NOT NULL
|
||||
) WITHOUT OIDS;
|
||||
|
||||
-- here we track the built packages
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue