method

insert_versions_sql

Importance_0
v5.0.0.1 - Show latest stable - 0 notes - Class: ActiveRecord::ConnectionAdapters::SchemaStatements
insert_versions_sql(versions) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb, line 992
      def insert_versions_sql(versions) # :nodoc:
        sm_table = ActiveRecord::Migrator.schema_migrations_table_name

        if supports_multi_insert?
          sql = "INSERT INTO #{sm_table} (version) VALUES "
          sql << versions.map {|v| "('#{v}')" }.join(', ')
          sql << ";\n\n"
          sql
        else
          versions.map { |version|
            "INSERT INTO #{sm_table} (version) VALUES ('#{version}');"
          }.join "\n\n"
        end
      end
Register or log in to add new notes.