Module: ActiveRecord::ConnectionAdapters::MySQL::ColumnDumper
- Included in:
- AbstractMysqlAdapter
- Defined in:
- lib/active_record/connection_adapters/mysql/schema_dumper.rb
Instance Method Summary collapse
- #column_spec_for_primary_key(column) ⇒ Object
- #migration_keys ⇒ Object
- #prepare_column_options(column) ⇒ Object
Instance Method Details
#column_spec_for_primary_key(column) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File '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_keys ⇒ Object
22 23 24 |
# File '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 'lib/active_record/connection_adapters/mysql/schema_dumper.rb', line 16 def (column) spec = super spec[:unsigned] = 'true' if column.unsigned? spec end |