Merge "Conditionally adjust for quoting in comparing MySQL defaults"
This commit is contained in:
commit
324d504d10
|
@ -476,9 +476,10 @@ class ModelsMigrationsSync(object):
|
|||
if isinstance(meta_col.type, sqlalchemy.Boolean):
|
||||
if meta_def is None or insp_def is None:
|
||||
return meta_def != insp_def
|
||||
insp_def = insp_def.strip("'")
|
||||
return not (
|
||||
isinstance(meta_def.arg, expr.True_) and insp_def == "'1'" or
|
||||
isinstance(meta_def.arg, expr.False_) and insp_def == "'0'"
|
||||
isinstance(meta_def.arg, expr.True_) and insp_def == "1" or
|
||||
isinstance(meta_def.arg, expr.False_) and insp_def == "0"
|
||||
)
|
||||
|
||||
impl_type = meta_col.type
|
||||
|
@ -487,7 +488,8 @@ class ModelsMigrationsSync(object):
|
|||
if isinstance(impl_type, (sqlalchemy.Integer, sqlalchemy.BigInteger)):
|
||||
if meta_def is None or insp_def is None:
|
||||
return meta_def != insp_def
|
||||
return meta_def.arg != insp_def.split("'")[1]
|
||||
insp_def = insp_def.strip("'")
|
||||
return meta_def.arg != insp_def
|
||||
|
||||
@_compare_server_default.dispatch_for('postgresql')
|
||||
def _compare_server_default(bind, meta_col, insp_def, meta_def):
|
||||
|
|
Loading…
Reference in New Issue