123456789_123456789_123456789_123456789_123456789_

Module: ActiveRecord::TestDatabases

Do not use. This module is for internal use only.
Relationships & Source Files
Defined in: activerecord/lib/active_record/test_databases.rb

Class Method Summary

Class Method Details

.create_and_load_schema(i, env_name:)

[ GitHub ]

  
# File 'activerecord/lib/active_record/test_databases.rb', line 11

def self.create_and_load_schema(i, env_name:)
  old, ENV["VERBOSE"] = ENV["VERBOSE"], "false"

  ActiveRecord::Base.configurations.configs_for(env_name: env_name).each do |db_config|
    db_config._database = "#{db_config.database}-#{i}"

    ActiveRecord::Tasks::DatabaseTasks.reconstruct_from_schema(db_config, ActiveRecord.schema_format, nil)
  end
ensure
  ActiveRecord::Base.establish_connection
  ENV["VERBOSE"] = old
end