<commit_before>module ActiveRecord::ConnectionAdapters
  # Add a @comment attribute to columns
  class Column
    attr_reader :comment
    alias column_comments_original_initialize initialize
    def initialize(name, default, sql_type = nil, null = true, comment = nil)
      column_comments_original_initialize(name, default, sql_type, null)
      @comment = comment
    end
  end
  
  class MysqlColumn < Column #:nodoc:
    def initialize(name, default, sql_type = nil, null = true, comment = nil)
      @original_default = default
      super
      @default = nil if missing_default_forged_as_empty_string?
    end
  end
  
  # Sneak the comment in through the add_column_options! method when create_table is called with a block
  class ColumnDefinition < ColumnDefinition.superclass #:nodoc:
    attr_accessor :comment
    
    private
    
      alias column_comments_original_add_column_options! add_column_options!
      def add_column_options!(sql, options)
        column_comments_original_add_column_options!(sql, options.merge(:comment => comment))
      end
  end
  
  # Pass the comment through the TableDefinition
  class TableDefinition
    alias column_comments_original_column column
    def column(name, type, options = {})
      column_comments_original_column(name, type, options)<commit_msg>fix to work with rails 2.3<commit_after>module ActiveRecord::ConnectionAdapters
  # Add a @comment attribute to columns
  class Column
    attr_reader :comment
    alias column_comments_original_initialize initialize
    def initialize(name, default, sql_type = nil, null = true, comment = nil)
      column_comments_original_initialize(name, default, sql_type, null)
      @comment = comment
    end
  end
  
  class MysqlColumn < Column #:nodoc:
    def initialize(name, default, sql_type = nil, null = true, comment = nil)
      @original_default = default
      super
      @default = nil if missing_default_forged_as_empty_string?(default)
    end
  end
  
  # Sneak the comment in through the add_column_options! method when create_table is called with a block
  class ColumnDefinition < ColumnDefinition.superclass #:nodoc:
    attr_accessor :comment
    
    private
    
      alias column_comments_original_add_column_options! add_column_options!
      def add_column_options!(sql, options)
        column_comments_original_add_column_options!(sql, options.merge(:comment => comment))
      end
  end
  
  # Pass the comment through the TableDefinition
  class TableDefinition
    alias column_comments_original_column column
    def column(name, type, options = {})
      column_comments_original_column(name, type, options)
{'fraction_non_alphanumeric': 0.060045317220543806, 'fraction_numerical': 0.0007552870090634441, 'mean_word_length': 3.9514018691588784, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '4189672', 'n_tokens_mistral': 730, 'n_tokens_neox': 725, 'n_words': 214}