class ActiveRecord::Migration::Compatibility::V5_0

def add_column(table_name, column_name, type, **options)

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