--- a/server/schema2sql.py Thu Dec 17 17:14:08 2015 +0100
+++ b/server/schema2sql.py Wed Dec 09 17:44:17 2015 +0100
@@ -219,11 +219,12 @@
"""return a sql type string corresponding to the constraints"""
constraints = list(constraints)
unique, sqltype = False, None
- size_constrained_string = dbhelper.TYPE_MAPPING.get('SizeConstrainedString', 'varchar(%s)')
if etype == 'String':
for constraint in constraints:
if isinstance(constraint, SizeConstraint):
if constraint.max is not None:
+ size_constrained_string = dbhelper.TYPE_MAPPING.get(
+ 'SizeConstrainedString', 'varchar(%s)')
sqltype = size_constrained_string % constraint.max
elif isinstance(constraint, UniqueConstraint):
unique = True