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

Inherits:
V7_0
  • Object
show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/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/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/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

#create_table(table_name, **options) ⇒ Object



59
60
61
62
63
64
65
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/migration/compatibility.rb', line 59

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