[fix] varchar length validation
This commit is contained in:
parent
e1ca0a89a7
commit
163c822ccd
1 changed files with 6 additions and 1 deletions
|
|
@ -119,7 +119,12 @@ class DbTable:
|
|||
|
||||
if max_length and max_length[0][0] > new_length:
|
||||
current_type = self.current_columns[col.fieldname]["type"]
|
||||
current_length = re.findall('varchar\(([\d]+)\)', current_type)[0]
|
||||
current_length = re.findall('varchar\(([\d]+)\)', current_type)
|
||||
if not current_length:
|
||||
# case when the field is no longer a varchar
|
||||
continue
|
||||
|
||||
current_length = current_length[0]
|
||||
|
||||
if col.fieldname in self.columns:
|
||||
self.columns[col.fieldname].length = current_length
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue