#388 Increase 50 character limit of tag names
Merged 5 years ago by mikem. Opened 5 years ago by breilly.
breilly/koji tag-names369  into  master

@@ -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;

file modified
+1 -1
@@ -277,7 +277,7 @@ 

  

  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);

file modified
+5
@@ -2846,6 +2846,11 @@ 

  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"

  

no initial comment

You didn't actually change the schema file

rebased

5 years ago

My mistake, I was only thinking in terms of upgrading...
Updated with the change.

Commit 670e708 fixes this pull-request

Pull-Request has been merged by mikem@redhat.com

5 years ago