Class: ActiveRecord::ConnectionAdapters::MySQL::Column

Inherits:
Column
  • Object
show all
Defined in:
lib/active_record/connection_adapters/mysql/column.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Column

#collation, #comment, #default, #default_function, #name, #null, #sql_type_metadata, #table_name

Instance Method Summary collapse

Methods inherited from Column

#==, #bigint?, #encode_with, #has_default?, #hash, #human_name, #init_with, #initialize

Constructor Details

This class inherits a constructor from ActiveRecord::ConnectionAdapters::Column

Instance Method Details

#auto_increment?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/active_record/connection_adapters/mysql/column.rb', line 15

def auto_increment?
  extra == "auto_increment"
end

#case_sensitive?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/active_record/connection_adapters/mysql/column.rb', line 11

def case_sensitive?
  collation && !/_ci\z/.match?(collation)
end

#unsigned?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/active_record/connection_adapters/mysql/column.rb', line 7

def unsigned?
  /\bunsigned(?: zerofill)?\z/.match?(sql_type)
end

#virtual?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/active_record/connection_adapters/mysql/column.rb', line 19

def virtual?
  /\b(?:VIRTUAL|STORED|PERSISTENT)\b/.match?(extra)
end