<commit_before>require 'active_record/scoping/default'
require 'active_record/scoping/named'
require 'active_record/base'

module ActiveRecord
  class SchemaMigration < ActiveRecord::Base
    attr_accessible :version

    def self.table_name
      Base.table_name_prefix + 'schema_migrations' + Base.table_name_suffix
    end

    def self.create_table
      unless connection.table_exists?(table_name)
        connection.create_table(table_name, :id => false) do |t|
          t.column :version, :string, :null => false
        end
        connection.add_index table_name, :version, :unique => true,
          :name => "#{Base.table_name_prefix}unique_schema_migrations#{Base.table_name_suffix}"
      end
    end

    def self.drop_table
      if connection.table_exists?(table_name)
        connection.remove_index table_name, :name => "#{Base.table_name_prefix}unique_schema_migrations#{Base.table_name_suffix}"
        connection.drop_table(table_name)<commit_msg>Remove duplicated unique index name.<commit_after>require 'active_record/scoping/default'
require 'active_record/scoping/named'
require 'active_record/base'

module ActiveRecord
  class SchemaMigration < ActiveRecord::Base
    attr_accessible :version

    def self.table_name
      "#{Base.table_name_prefix}schema_migrations#{Base.table_name_suffix}"
    end

    def self.index_name
      "#{Base.table_name_prefix}unique_schema_migrations#{Base.table_name_suffix}"
    end

    def self.create_table
      unless connection.table_exists?(table_name)
        connection.create_table(table_name, :id => false) do |t|
          t.column :version, :string, :null => false
        end
        connection.add_index table_name, :version, :unique => true, :name => index_name
      end
    end

    def self.drop_table
      if connection.table_exists?(table_name)
        connection.remove_index table_name, :name => index_name
        connection.drop_table(table_name)
{'fraction_non_alphanumeric': 0.09198966408268734, 'fraction_numerical': 0.0, 'mean_word_length': 3.864321608040201, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '6265270', 'n_tokens_mistral': 581, 'n_tokens_neox': 581, 'n_words': 109}