Class: ActiveRecord::ConnectionAdapters::SQLite3::TableDefinition
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
|
|
Instance Chain:
|
|
Inherits: |
ActiveRecord::ConnectionAdapters::TableDefinition
|
Defined in: | activerecord/lib/active_record/connection_adapters/sqlite3/schema_definitions.rb |
Overview
Active Record SQLite3 Adapter Table Definition
Class Method Summary
Instance Attribute Summary
Instance Method Summary
-
#belongs_to(*args, **options)
Alias for #references.
- #change_column(column_name, type, **options)
- #references(*args, **options) (also: #belongs_to)
- #integer_like_primary_key_type(type, options) private
- #valid_column_definition_options private
- #new_column_definition(name, type, **options) Internal use only
::ActiveRecord::ConnectionAdapters::TableDefinition
- Inherited
#[] | Returns a |
#belongs_to | Alias for TableDefinition#references. |
#blob, #check_constraint, | |
#column | Instantiates a new column for the table. |
#columns | Returns an array of |
#foreign_key, | |
#index | Adds index options to the indexes hash, keyed by column name This is primarily used to track indexes that need to be created after the table. |
#numeric, | |
#references | Adds a reference. |
#remove_column | remove the column |
#set_primary_key, | |
#timestamps | Appends |
#aliased_types, #create_column_definition, #integer_like_primary_key?, #integer_like_primary_key_type, #raise_on_duplicate_column, #valid_column_definition_options, #new_check_constraint_definition, #new_column_definition, #new_foreign_key_definition, #primary_keys |
::ActiveRecord::ConnectionAdapters::ColumnMethods
- Included
#column | Appends a column or columns of a specified type. |
#primary_key | Appends a primary key definition to the table definition. |
Constructor Details
This class inherits a constructor from ActiveRecord::ConnectionAdapters::TableDefinition
Instance Method Details
#belongs_to(*args, **options)
Alias for #references.
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/schema_definitions.rb', line 17
alias :belongs_to :references
#change_column(column_name, type, **options)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/sqlite3/schema_definitions.rb', line 8
def change_column(column_name, type, ** ) name = column_name.to_s @columns_hash[name] = nil column(name, type, ** ) end
#integer_like_primary_key_type(type, options) (private)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/sqlite3/schema_definitions.rb', line 29
def integer_like_primary_key_type(type, ) :primary_key end
#new_column_definition(name, type, **options)
# File 'activerecord/lib/active_record/connection_adapters/sqlite3/schema_definitions.rb', line 19
def new_column_definition(name, type, ** ) # :nodoc: case type when :virtual type = [:type] end super end
#references(*args, **options) Also known as: #belongs_to
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/sqlite3/schema_definitions.rb', line 14
def references(*args, ** ) super(*args, type: :integer, ** ) end
#valid_column_definition_options (private)
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/sqlite3/schema_definitions.rb', line 33
def super + [:as, :type, :stored] end