method

new_column_definition

Importance_0
v5.0.0.1 - Show latest stable - 0 notes - Class: TableDefinition
new_column_definition(name, type, options) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 66
        def new_column_definition(name, type, options) # :nodoc:
          column = super
          case column.type
          when :primary_key
            column.type = :integer
            column.auto_increment = true
          when /\Aunsigned_(?<type>.+)\z/
            column.type = $~[:type].to_sym
            column.unsigned = true
          end
          column.unsigned ||= options[:unsigned]
          column.charset = options[:charset]
          column
        end
Register or log in to add new notes.