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

Inherits:
TableDefinition
  • Object
show all
Includes:
ColumnMethods
Defined in:
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 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 '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 '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 '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