Class: ActiveRecord::ConnectionAdapters::SQLite3::TableDefinition
- Inherits:
-
TableDefinition
- Object
- TableDefinition
- ActiveRecord::ConnectionAdapters::SQLite3::TableDefinition
- Defined in:
- lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
Overview
Active Record SQLite3 Adapter Table Definition
Instance Attribute Summary
Attributes inherited from TableDefinition
#as, #check_constraints, #comment, #foreign_keys, #if_not_exists, #indexes, #name, #options, #temporary
Instance Method Summary collapse
- #change_column(column_name, type, **options) ⇒ Object
-
#new_column_definition(name, type, **options) ⇒ Object
:nodoc:.
- #references(*args, **options) ⇒ Object (also: #belongs_to)
Methods inherited from TableDefinition
#[], #check_constraint, #column, #columns, #foreign_key, #index, #initialize, #new_check_constraint_definition, #new_foreign_key_definition, #primary_keys, #remove_column, #set_primary_key, #timestamps
Methods included from ColumnMethods
Constructor Details
This class inherits a constructor from ActiveRecord::ConnectionAdapters::TableDefinition
Instance Method Details
#change_column(column_name, type, **options) ⇒ Object
8 9 10 11 12 |
# File '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 |
#new_column_definition(name, type, **options) ⇒ Object
:nodoc:
19 20 21 22 23 24 25 26 |
# File '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) ⇒ Object Also known as: belongs_to
14 15 16 |
# File 'lib/active_record/connection_adapters/sqlite3/schema_definitions.rb', line 14 def references(*args, **) super(*args, type: :integer, **) end |