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

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

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#migration_keysObject


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

def migration_keys
  super + [:unsigned]
end

#prepare_column_options(column) ⇒ Object


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

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

  if supports_virtual_columns? && column.virtual?
    spec[:as] = extract_expression_for_virtual_column(column)
    spec[:stored] = "true" if /\b(?:STORED|PERSISTENT)\b/.match?(column.extra)
    spec = { type: schema_type(column).inspect }.merge!(spec)
  end

  spec
end