PR#388 Increase 50 character limit of tag names
Merges #388 https://pagure.io/koji/pull-request/388 Fixes #369 https://pagure.io/koji/issue/369
This commit is contained in:
commit
670e7086b3
3 changed files with 15 additions and 1 deletions
9
docs/schema-upgrade-1.12-1.13.sql
Normal file
9
docs/schema-upgrade-1.12-1.13.sql
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
-- upgrade script to migrate the Koji database schema
|
||||
-- from version 1.12 to 1.13
|
||||
|
||||
BEGIN;
|
||||
|
||||
-- Change VARCHAR field for tag names to TEXT to allow longer tag names
|
||||
ALTER TABLE tag ALTER COLUMN name TYPE TEXT;
|
||||
|
||||
COMMIT;
|
||||
|
|
@ -278,7 +278,7 @@ CREATE TABLE build_types (
|
|||
|
||||
CREATE TABLE tag (
|
||||
id SERIAL NOT NULL PRIMARY KEY,
|
||||
name VARCHAR(50) UNIQUE NOT NULL
|
||||
name TEXT UNIQUE NOT NULL
|
||||
) WITHOUT OIDS;
|
||||
|
||||
-- CREATE INDEX tag_by_name ON tag (name);
|
||||
|
|
|
|||
|
|
@ -2878,6 +2878,11 @@ def create_tag(name, parent=None, arches=None, perm=None, locked=False, maven_su
|
|||
def _create_tag(name, parent=None, arches=None, perm=None, locked=False, maven_support=False, maven_include_all=False, extra=None):
|
||||
"""Create a new tag, without access check"""
|
||||
|
||||
max_name_length = 256
|
||||
if len(name) > max_name_length:
|
||||
raise koji.GenericError("Tag name %s is too long. Max length is %s characters",
|
||||
name, max_name_length)
|
||||
|
||||
if not context.opts.get('EnableMaven') and (maven_support or maven_include_all):
|
||||
raise koji.GenericError("Maven support not enabled")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue