def alter_table(table_name, options = {}) #:nodoc:
      table_name = table_name.to_s.downcase
      altered_table_name = "altered_#{table_name}"
      caller = lambda {|definition| yield definition if block_given?}

      transaction do
        # A temporary table might improve performance here, but
        # it doesn't seem to maintain indices across the whole move.
        move_table(table_name, altered_table_name,
          options)
        move_table(altered_table_name, table_name, &caller)
      end
    end
def alter_table(table_name, options = {}) #:nodoc:
      table_name = table_name.to_s.downcase
      altered_table_name = "altered_#{table_name}"
      caller = lambda {|definition| yield definition if block_given?}

      transaction do
        # A temporary table might improve performance here, but
        # it doesn't seem to maintain indices across the whole move.
        move_table(table_name, altered_table_name,
          options)
        move_table(altered_table_name, table_name, &caller)
      end
    end
Taken from SQLite adapter