'Alters the given column name so it will match the given field.
Note that conversion between the two by the database must be possible.
Will not automatically add _id by default; to have this behavour, pass
explicit_name=False.
@param table_name: The name of the table to add the column to
@param name: The name of the column to alter
@param field: The new field definition to use'

@invalidate_table_constraints
def alter_column(self, table_name, name, field, explicit_name=True, ignore_constraints=False):

    if self.dry_run:
        if self.debug:
            print('            -    no    dry    run    output    for    alter_column()    due    to    dynamic    DDL,    sorry')
        return
    if hasattr(field, 'south_init'):
        field.south_init()
    field.set_attributes_from_name(name)
    if (not explicit_name):
        name = field.column
    else:
        field.column = name
    if (not ignore_constraints):
        if self.has_check_constraints:
            check_constraints = self._constraints_affecting_columns(table_name, [name], 'CHECK')
            for constraint in check_constraints:
                self.execute((self.delete_check_sql % {'table': self.quote_name(table_name), 'constraint': self.quote_name(constraint)}))
        try:
            self.delete_foreign_key(table_name, name)
        except ValueError:
            pass
    params = {'column': self.quote_name(name), 'type': self._db_type_for_alter_column(field), 'table_name': self.quote_name(table_name)}
    sqls = []
    if (params['type'] is not None):
        sqls.append(((self.alter_string_set_type % params), []))
    self._alter_add_column_mods(field, name, params, sqls)
    if (field.null or field.has_default()):
        sqls.append(((self.alter_string_set_null % params), []))
    else:
        sqls.append(((self.alter_string_drop_null % params), []))
    self._alter_set_defaults(field, name, params, sqls)
    if self.allows_combined_alters:
        (sqls, values) = zip(*sqls)
        self.execute(('ALTER    TABLE    %s    %s;' % (self.quote_name(table_name), ',    '.join(sqls))), flatten(values))
    else:
        for (sql, values) in sqls:
            self.execute(('ALTER    TABLE    %s    %s;' % (self.quote_name(table_name), sql)), values)
    if ((not field.null) and field.has_default()):
        self._update_nulls_to_default(params, field)
        self.execute(('ALTER    TABLE    %s    %s;' % (self.quote_name(table_name), (self.alter_string_drop_null % params))), [])
    if (not ignore_constraints):
        if (field.rel and self.supports_foreign_keys):
            self.execute(self.foreign_key_sql(table_name, field.column, field.rel.to._meta.db_table, field.rel.to._meta.get_field(field.rel.field_name).column))
