Method: ActiveRecord::ConnectionAdapters::MySQL::TableDefinition#new_column_definition

Defined in:
activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb

#new_column_definition(name, type, **options) ⇒ Object

:nodoc:



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 66

def new_column_definition(name, type, **options) # :nodoc:
  case type
  when :virtual
    type = options[:type]
  when :primary_key
    type = :integer
    options[:limit] ||= 8
    options[:primary_key] = true
  when /\Aunsigned_(?<type>.+)\z/
    type = $~[:type].to_sym
    options[:unsigned] = true
  end

  super
end