# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 7 def primary_key(name, type = :primary_key, **options) options[:auto_increment] = true if [:integer, :bigint].include?(type) && !options.key?(:default) super end
module ActiveRecord::ConnectionAdapters::MySQL::ColumnMethods
Public Instance Methods
blob(*args, **options)
click to toggle source
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 12 def blob(*args, **options) args.each { |name| column(name, :blob, options) } end
json(*args, **options)
click to toggle source
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 40 def json(*args, **options) args.each { |name| column(name, :json, options) } end
longblob(*args, **options)
click to toggle source
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 24 def longblob(*args, **options) args.each { |name| column(name, :longblob, options) } end
longtext(*args, **options)
click to toggle source
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 36 def longtext(*args, **options) args.each { |name| column(name, :longtext, options) } end
mediumblob(*args, **options)
click to toggle source
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 20 def mediumblob(*args, **options) args.each { |name| column(name, :mediumblob, options) } end
mediumtext(*args, **options)
click to toggle source
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 32 def mediumtext(*args, **options) args.each { |name| column(name, :mediumtext, options) } end
primary_key(name, type = :primary_key, **options)
click to toggle source
Calls superclass method
tinyblob(*args, **options)
click to toggle source
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 16 def tinyblob(*args, **options) args.each { |name| column(name, :tinyblob, options) } end
tinytext(*args, **options)
click to toggle source
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 28 def tinytext(*args, **options) args.each { |name| column(name, :tinytext, options) } end
unsigned_bigint(*args, **options)
click to toggle source
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 48 def unsigned_bigint(*args, **options) args.each { |name| column(name, :unsigned_bigint, options) } end
unsigned_decimal(*args, **options)
click to toggle source
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 56 def unsigned_decimal(*args, **options) args.each { |name| column(name, :unsigned_decimal, options) } end
unsigned_float(*args, **options)
click to toggle source
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 52 def unsigned_float(*args, **options) args.each { |name| column(name, :unsigned_float, options) } end
unsigned_integer(*args, **options)
click to toggle source
# File activerecord/lib/active_record/connection_adapters/mysql/schema_definitions.rb, line 44 def unsigned_integer(*args, **options) args.each { |name| column(name, :unsigned_integer, options) } end