Module: ActiveRecord::ConnectionAdapters::MySQL::ColumnMethods

Included in:
Table, TableDefinition
Defined in:
lib/active_record/connection_adapters/mysql/schema_definitions.rb

Instance Method Summary collapse

Instance Method Details

#blob(*args, **options) ⇒ Object



10
11
12
# File 'lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 10

def blob(*args, **options)
  args.each { |name| column(name, :blob, options) }
end

#json(*args, **options) ⇒ Object



38
39
40
# File 'lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 38

def json(*args, **options)
  args.each { |name| column(name, :json, options) }
end

#longblob(*args, **options) ⇒ Object



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

def longblob(*args, **options)
  args.each { |name| column(name, :longblob, options) }
end

#longtext(*args, **options) ⇒ Object



34
35
36
# File 'lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 34

def longtext(*args, **options)
  args.each { |name| column(name, :longtext, options) }
end

#mediumblob(*args, **options) ⇒ Object



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

def mediumblob(*args, **options)
  args.each { |name| column(name, :mediumblob, options) }
end

#mediumtext(*args, **options) ⇒ Object



30
31
32
# File 'lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 30

def mediumtext(*args, **options)
  args.each { |name| column(name, :mediumtext, options) }
end

#primary_key(name, type = :primary_key, **options) ⇒ Object



5
6
7
8
# File 'lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 5

def primary_key(name, type = :primary_key, **options)
  options[:auto_increment] = true if [:integer, :bigint].include?(type) && !options.key?(:default)
  super
end

#tinyblob(*args, **options) ⇒ Object



14
15
16
# File 'lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 14

def tinyblob(*args, **options)
  args.each { |name| column(name, :tinyblob, options) }
end

#tinytext(*args, **options) ⇒ Object



26
27
28
# File 'lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 26

def tinytext(*args, **options)
  args.each { |name| column(name, :tinytext, options) }
end

#unsigned_bigint(*args, **options) ⇒ Object



46
47
48
# File 'lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 46

def unsigned_bigint(*args, **options)
  args.each { |name| column(name, :unsigned_bigint, options) }
end

#unsigned_decimal(*args, **options) ⇒ Object



54
55
56
# File 'lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 54

def unsigned_decimal(*args, **options)
  args.each { |name| column(name, :unsigned_decimal, options) }
end

#unsigned_float(*args, **options) ⇒ Object



50
51
52
# File 'lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 50

def unsigned_float(*args, **options)
  args.each { |name| column(name, :unsigned_float, options) }
end

#unsigned_integer(*args, **options) ⇒ Object



42
43
44
# File 'lib/active_record/connection_adapters/mysql/schema_definitions.rb', line 42

def unsigned_integer(*args, **options)
  args.each { |name| column(name, :unsigned_integer, options) }
end