Class: ActiveRecord::ConnectionAdapters::SQLite3::TableDefinition

Inherits:
TableDefinition
  • Object
show all
Defined in:
lib/active_record/connection_adapters/sqlite3/schema_definitions.rb

Instance Attribute Summary

Attributes inherited from TableDefinition

#as, #check_constraints, #comment, #foreign_keys, #if_not_exists, #indexes, #name, #options, #temporary

Instance Method Summary collapse

Methods inherited from TableDefinition

#[], #check_constraint, #column, #columns, #foreign_key, #index, #initialize, #new_check_constraint_definition, #new_column_definition, #new_foreign_key_definition, #primary_keys, #remove_column, #timestamps

Methods included from ColumnMethods

#primary_key

Constructor Details

This class inherits a constructor from ActiveRecord::ConnectionAdapters::TableDefinition

Instance Method Details

#change_column(column_name, type, **options) ⇒ Object



7
8
9
10
11
# File 'lib/active_record/connection_adapters/sqlite3/schema_definitions.rb', line 7

def change_column(column_name, type, **options)
  name = column_name.to_s
  @columns_hash[name] = nil
  column(name, type, **options)
end

#references(*args, **options) ⇒ Object Also known as: belongs_to



13
14
15
# File 'lib/active_record/connection_adapters/sqlite3/schema_definitions.rb', line 13

def references(*args, **options)
  super(*args, type: :integer, **options)
end