Module: ActiveRecord::ConnectionAdapters::MySQL::ColumnDumper

Included in:
AbstractMysqlAdapter
Defined in:
activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb

Instance Method Summary collapse

Instance Method Details

#column_spec_for_primary_key(column) ⇒ Object


5
6
7
8
9
10
11
12
13
14
# File 'activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb', line 5

def column_spec_for_primary_key(column)
  if column.bigint?
    spec = { id: :bigint.inspect }
    spec[:default] = schema_default(column) || 'nil' unless column.auto_increment?
  else
    spec = super
  end
  spec[:unsigned] = 'true' if column.unsigned?
  spec
end

#migration_keysObject


22
23
24
# File 'activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb', line 22

def migration_keys
  super + [:unsigned]
end

#prepare_column_options(column) ⇒ Object


16
17
18
19
20
# File 'activerecord/lib/active_record/connection_adapters/mysql/schema_dumper.rb', line 16

def prepare_column_options(column)
  spec = super
  spec[:unsigned] = 'true' if column.unsigned?
  spec
end