<commit_before>require 'rails3_datamapper/setup'
require 'rails3_datamapper/storage'

namespace :db do

  task :load_config => :rails_env do
    Rails::DataMapper.configurations = Rails::Application.config.database_configuration
  end

  task :load_models => :environment do
    FileList["app/models/**/*.rb"].each { |model| load model }
  end


  namespace :create do
    desc 'Create all the local databases defined in config/database.yml'
    task :all => :load_config do
      Rails::DataMapper::Storage.create_local_databases
    end
  end

  desc "Create the database defined in config/database.yml for the current Rails.env - also creates the test database if Rails.env.development?"
  task :create => :load_config do
    Rails::DataMapper::Storage.create_database(Rails::DataMapper.configurations[Rails.env])
    if Rails.env.development? && Rails::DataMapper::Storage.configurations['test']
      Rails::DataMapper::Storage.create_database(Rails::DataMapper.configurations['test'])
    end
  end

  namespace :drop do
    desc 'Drop all the local databases defined in config/database.yml'
    task :all => :load_config do
      Rails::DataMapper::Storage.drop_local_databases
    end
  end

  desc "Drops the database for the current Rails.env"
  task :drop => :load_config do
    Rails::DataMapper::Storage.drop_database(Rails::DataMapper.configurations[Rails.env])
  end


  desc 'Perform destructive automigration'
  task :automigrate => :load_models do
    ::DataMapper.auto_migrate!<commit_msg>Fixed guard for implicit test database generation<commit_after>require 'rails3_datamapper/setup'
require 'rails3_datamapper/storage'

namespace :db do

  task :load_config => :rails_env do
    Rails::DataMapper.configurations = Rails::Application.config.database_configuration
  end

  task :load_models => :environment do
    FileList["app/models/**/*.rb"].each { |model| load model }
  end


  namespace :create do
    desc 'Create all the local databases defined in config/database.yml'
    task :all => :load_config do
      Rails::DataMapper::Storage.create_local_databases
    end
  end

  desc "Create the database defined in config/database.yml for the current Rails.env - also creates the test database if Rails.env.development?"
  task :create => :load_config do
    Rails::DataMapper::Storage.create_database(Rails::DataMapper.configurations[Rails.env])
    if Rails.env.development? && Rails::DataMapper.configurations['test']
      Rails::DataMapper::Storage.create_database(Rails::DataMapper.configurations['test'])
    end
  end

  namespace :drop do
    desc 'Drop all the local databases defined in config/database.yml'
    task :all => :load_config do
      Rails::DataMapper::Storage.drop_local_databases
    end
  end

  desc "Drops the database for the current Rails.env"
  task :drop => :load_config do
    Rails::DataMapper::Storage.drop_database(Rails::DataMapper.configurations[Rails.env])
  end


  desc 'Perform destructive automigration'
  task :automigrate => :load_models do
    ::DataMapper.auto_migrate!
{'fraction_non_alphanumeric': 0.1005586592178771, 'fraction_numerical': 0.0013144922773578706, 'mean_word_length': 4.544626593806922, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, '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': '1680823', 'n_tokens_mistral': 935, 'n_tokens_neox': 878, 'n_words': 231}