<commit_before>tasks = Rake.application.instance_variable_get '@tasks'
override_tasks = ['db:create', 'db:drop', 'db:migrate', 'db:schema:dump']
unsupported_tasks = ['db:schema:load']
(override_tasks + unsupported_tasks).each { |task_name| tasks.delete(task_name) }

db_namespace = namespace :db do
  desc 'Create the multiple databases from config/database.yml for the current Rails.env (use db:create:all to create all dbs in the config)'
  task :create => :load_config do
    configs_for_multi_environment.each { |config| create_database(config) }
  end

  desc "Migrate the database (options: VERSION=x, VERBOSE=false)."
  task :migrate => [:environment, :load_config] do
    ActiveRecord::Base.establish_connection(Rails.env)

    ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
    ActiveRecord::Migrator.migrate(ActiveRecord::Migrator.migrations_paths, ENV["VERSION"] ? ENV["VERSION"].to_i : nil) do |migration|
      ENV["SCOPE"].blank? || (ENV["SCOPE"] == migration.scope)
    end
    db_namespace['_dump'].invoke
  end

  desc 'Drops the multiple databases for the current Rails.env (use db:drop:all to drop all databases)'
  task :drop => :load_config do<commit_msg>Revert "deleted db:schema:load task"<commit_after>tasks = Rake.application.instance_variable_get '@tasks'
override_tasks = ['db:create', 'db:drop', 'db:migrate', 'db:schema:dump']
override_tasks.each { |task_name| tasks.delete(task_name) }

db_namespace = namespace :db do
  desc 'Create the multiple databases from config/database.yml for the current Rails.env (use db:create:all to create all dbs in the config)'
  task :create => :load_config do
    configs_for_multi_environment.each { |config| create_database(config) }
  end

  desc "Migrate the database (options: VERSION=x, VERBOSE=false)."
  task :migrate => [:environment, :load_config] do
    ActiveRecord::Base.establish_connection(Rails.env)

    ActiveRecord::Migration.verbose = ENV["VERBOSE"] ? ENV["VERBOSE"] == "true" : true
    ActiveRecord::Migrator.migrate(ActiveRecord::Migrator.migrations_paths, ENV["VERSION"] ? ENV["VERSION"].to_i : nil) do |migration|
      ENV["SCOPE"].blank? || (ENV["SCOPE"] == migration.scope)
    end
    db_namespace['_dump'].invoke
  end

  desc 'Drops the multiple databases for the current Rails.env (use db:drop:all to drop all databases)'
  task :drop => :load_config do
{'fraction_non_alphanumeric': 0.134953897736798, 'fraction_numerical': 0.0, 'mean_word_length': 5.53972602739726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3078185', 'n_tokens_mistral': 785, 'n_tokens_neox': 766, 'n_words': 189}