Class: ActiveRecord::ConnectionAdapters::PostgreSQL::TableDefinition

Inherits:
TableDefinition show all
Includes:
ColumnMethods
Defined in:
activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb

Instance Attribute Summary collapse

Attributes inherited from TableDefinition

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

Instance Method Summary collapse

Methods included from ColumnMethods

#primary_key

Methods included from ActiveSupport::Concern

#append_features, #class_methods, extended, #included, #prepend_features, #prepended

Methods inherited from TableDefinition

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

Methods included from ColumnMethods

#primary_key

Constructor Details

#initializeTableDefinition

Returns a new instance of TableDefinition.


197
198
199
200
# File 'activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 197

def initialize(*, **)
  super
  @unlogged = ActiveRecord::ConnectionAdapters::PostgreSQLAdapter.create_unlogged_tables
end

Instance Attribute Details

#unloggedObject (readonly)

Returns the value of attribute unlogged.


195
196
197
# File 'activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 195

def unlogged
  @unlogged
end

Instance Method Details

#new_column_definition(name, type, **options) ⇒ Object

:nodoc:


202
203
204
205
206
207
208
209
# File 'activerecord/lib/active_record/connection_adapters/postgresql/schema_definitions.rb', line 202

def new_column_definition(name, type, **options) # :nodoc:
  case type
  when :virtual
    type = options[:type]
  end

  super
end