123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::ConnectionAdapters::ColumnDefinition

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ::Struct
Instance Chain:
self, ::Struct
Inherits: Struct
Defined in: activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb

Overview

Abstract representation of a column definition. Instances of this type are typically created by methods in TableDefinition, and added to the columns attribute of said TableDefinition object, in order to be used for generating a number of table creation or table changing SQL statements.

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#cast_type (rw)

This method is for internal use only.

Abstract representation of a column definition. Instances of this type are typically created by methods in TableDefinition, and added to the columns attribute of said TableDefinition object, in order to be used for generating a number of table creation or table changing SQL statements.

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 123

ColumnDefinition = Struct.new(:name, :type, :options, :sql_type, :cast_type)

#collation (rw)

Deprecated.

use options instead

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 166

def collation = options[:collation]

#collation=(value) (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 167

def collation=(value)
  options[:collation] = value
end

#comment (rw)

Deprecated.

use options instead

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 171

def comment = options[:comment]

#comment=(value) (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 172

def comment=(value)
  options[:comment] = value
end

#default (rw)

Deprecated.

use options instead

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 156

def default = options[:default]

#default=(value) (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 157

def default=(value)
  options[:default] = value
end

#if_exists (rw)

Deprecated.

use options instead

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 176

def if_exists = options[:if_exists]

#if_exists=(value) (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 177

def if_exists=(value)
  options[:if_exists] = value
end

#if_not_exists (rw)

Deprecated.

use options instead

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 181

def if_not_exists = options[:if_not_exists]

#if_not_exists=(value) (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 182

def if_not_exists=(value)
  options[:if_not_exists] = value
end

#limit (rw)

Deprecated.

use options instead

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 141

def limit = options[:limit]

#limit=(value) (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 142

def limit=(value)
  options[:limit] = value
end

#name (rw)

This method is for internal use only.

Abstract representation of a column definition. Instances of this type are typically created by methods in TableDefinition, and added to the columns attribute of said TableDefinition object, in order to be used for generating a number of table creation or table changing SQL statements.

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 123

ColumnDefinition = Struct.new(:name, :type, :options, :sql_type, :cast_type)

#null (rw)

Deprecated.

use options instead

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 161

def null = options[:null]

#null=(value) (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 162

def null=(value)
  options[:null] = value
end

#options (rw)

This method is for internal use only.

Abstract representation of a column definition. Instances of this type are typically created by methods in TableDefinition, and added to the columns attribute of said TableDefinition object, in order to be used for generating a number of table creation or table changing SQL statements.

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 123

ColumnDefinition = Struct.new(:name, :type, :options, :sql_type, :cast_type)

#precision (rw)

Deprecated.

use options instead

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 146

def precision = options[:precision]

#precision=(value) (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 147

def precision=(value)
  options[:precision] = value
end

#primary_key? ⇒ Boolean (readonly)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 137

def primary_key?
  options[:primary_key]
end

#scale (rw)

Deprecated.

use options instead

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 151

def scale = options[:scale]

#scale=(value) (rw)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 152

def scale=(value)
  options[:scale] = value
end

#sql_type (rw)

This method is for internal use only.

Abstract representation of a column definition. Instances of this type are typically created by methods in TableDefinition, and added to the columns attribute of said TableDefinition object, in order to be used for generating a number of table creation or table changing SQL statements.

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 123

ColumnDefinition = Struct.new(:name, :type, :options, :sql_type, :cast_type)

#type (rw)

This method is for internal use only.

Abstract representation of a column definition. Instances of this type are typically created by methods in TableDefinition, and added to the columns attribute of said TableDefinition object, in order to be used for generating a number of table creation or table changing SQL statements.

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 123

ColumnDefinition = Struct.new(:name, :type, :options, :sql_type, :cast_type)

Instance Method Details

#aliased_types(name, fallback)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb', line 208

def aliased_types(name, fallback)
  "timestamp" == name ? :datetime : fallback
end