in core/lib/sqlparse/models.py [0:0]
def has_same_default(self, other):
# nullable column has implicit default as null
if self.nullable:
if self.quoted_default != other.quoted_default:
# Implicit NULL equals to explicit default NULL
# Other than that if there's any difference between two
# default values they are semanticly different
left_default_is_null = (
self.default is None or self.default.upper() == "NULL"
)
right_default_is_null = (
other.default is None or other.default.upper() == "NULL"
)
if not (left_default_is_null and right_default_is_null):
return False
else:
if self.quoted_default != other.quoted_default:
return False
return True