fixed problem with case in migrations

This commit is contained in:
mdipierro
2012-08-31 13:32:22 -05:00
parent 665a5cdee2
commit e82982d25d
2 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.0.3 (2012-08-31 11:08:15) stable
Version 2.0.3 (2012-08-31 13:32:07) stable
+7 -5
View File
@@ -943,7 +943,8 @@ class BaseAdapter(ConnectionPool):
if not isinstance(v,dict):
v=dict(type='unkown',sql=v)
return k.lower(),v
### make sure all field names are lower case to avoid conflicts
# make sure all field names are lower case to avoid
# migrations because of case cahnge
sql_fields = dict(map(fix,sql_fields.iteritems()))
sql_fields_old = dict(map(fix,sql_fields_old.iteritems()))
sql_fields_aux = dict(map(fix,sql_fields_aux.iteritems()))
@@ -993,10 +994,11 @@ class BaseAdapter(ConnectionPool):
query = ['ALTER TABLE %s DROP %s;' % (tablename, key)]
metadata_change = True
elif sql_fields[key]['sql'] != sql_fields_old[key]['sql'] \
and not isinstance(table[key].type, SQLCustomType) \
and not table[key].type.startswith('reference')\
and not table[key].type.startswith('double')\
and not table[key].type.startswith('id'):
and not (key in table.fields and
isinstance(table[key].type, SQLCustomType)) \
and not sql_fields[key]['type'].startswith('reference')\
and not sql_fields[key]['type'].startswith('double')\
and not sql_fields[key]['type'].startswith('id'):
sql_fields_current[key] = sql_fields[key]
t = tablename
tt = sql_fields_aux[key]['sql'].replace(', ', new_add)