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

Inherits:
V7_0
  • Object
show all
Defined in:
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



50
51
52
53
54
55
56
57
# File 'lib/active_record/migration/compatibility.rb', line 50

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_column(table_name, column_name, type, **options) ⇒ Object



59
60
61
62
63
64
65
66
# File 'lib/active_record/migration/compatibility.rb', line 59

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

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