Class: ActiveRecord::Migration::Compatibility::V6_1

Inherits:
V7_0
  • Object
show all
Defined in:
activerecord/lib/active_record/migration/compatibility.rb

Direct Known Subclasses

V6_0

Defined Under Namespace

Modules: TableDefinition Classes: PostgreSQLCompat

Instance Method Summary collapse

Instance Method Details

#add_column(table_name, column_name, type, **options) ⇒ Object


82
83
84
85
86
87
88
89
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 82

def add_column(table_name, column_name, type, **options)
  if type == :datetime
    options[:precision] ||= nil
  end

  type = PostgreSQLCompat.compatible_timestamp_type(type, connection)
  super
end

#change_table(table_name, **options) ⇒ Object


99
100
101
102
103
104
105
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 99

def change_table(table_name, **options)
  if block_given?
    super { |t| yield compatible_table_definition(t) }
  else
    super
  end
end

#create_table(table_name, **options) ⇒ Object


91
92
93
94
95
96
97
# File 'activerecord/lib/active_record/migration/compatibility.rb', line 91

def create_table(table_name, **options)
  if block_given?
    super { |t| yield compatible_table_definition(t) }
  else
    super
  end
end