method

bulk_change_table

rails latest stable - Class: ActiveRecord::ConnectionAdapters

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v5.2.3) is shown here.

bulk_change_table(table_name, operations)
public

No documentation available.

# File activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb, line 295
      def bulk_change_table(table_name, operations) #:nodoc:
        sqls = operations.flat_map do |command, args|
          table, arguments = args.shift, args
          method = :"#{command}_for_alter"

          if respond_to?(method, true)
            send(method, table, *arguments)
          else
            raise "Unknown method called : #{method}(#{arguments.inspect})"
          end
        end.join(", ")

        execute("ALTER TABLE #{quote_table_name(table_name)} #{sqls}")
      end