ActiveRecord::ConnectionAdapters::TableDefinition

class ActiveRecord::ConnectionAdapters::TableDefinition

Parent:
Object
Included modules:
ActiveRecord::ConnectionAdapters::ColumnMethods

Represents the schema of an SQL table in an abstract way. This class provides methods for manipulating the schema representation.

Inside migration files, the t object in create_table is actually of this type:

class SomeMigration < ActiveRecord::Migration[5.0]
  def up
    create_table :foo do |t|
      puts t.class  # => "ActiveRecord::ConnectionAdapters::TableDefinition"
    end
  end

  def down
    ...