def _update_col_attrs_changes()

in core/lib/sqlparse/diff.py [0:0]


    def _update_col_attrs_changes(self, new_col, old_col):
        if (
            new_col.column_type != old_col.column_type
            or new_col.length != old_col.length
        ):
            self.add_alter_type(ColAlterType.CHANGE_COL_DATA_TYPE)
        if (
            self._is_col_default_change(old_col, new_col)
            and ColAlterType.CHANGE_COL_DATA_TYPE not in self._alter_types
        ):
            self.add_alter_type(ColAlterType.CHANGE_COL_DEFAULT_VAL)
        if (
            self._is_null_change(old_col, new_col)
            and ColAlterType.CHANGE_COL_DATA_TYPE not in self._alter_types
        ):
            self.add_alter_type(ColAlterType.CHANGE_NULL)
        if (
            isinstance(new_col, EnumColumn)
            and isinstance(old_col, EnumColumn)
            and new_col.enum_list != old_col.enum_list
        ):
            self.add_alter_type(ColAlterType.CHANGE_ENUM)
        if (
            isinstance(new_col, SetColumn)
            and isinstance(old_col, SetColumn)
            and new_col.set_list != old_col.set_list
        ):
            self.add_alter_type(ColAlterType.CHANGE_SET)
        if new_col.charset != old_col.charset:
            self.add_alter_type(ColAlterType.CHANGE_COL_CHARSET)
        if new_col.collate != old_col.collate:
            self.add_alter_type(ColAlterType.CHANGE_COL_COLLATE)
        if new_col.comment != old_col.comment:
            self.add_alter_type(ColAlterType.CHANGE_COL_COMMENT)