class <%= @class_name %><%= @class_suffix %> < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version.to_s %>] def change <% @checks[:foreign_keys].each do |fk| %> reversible do |dir| dir.up do <% if fk.nullable? %> # <%= fk.to_zombie.migration %> <%= fk.to_zombie.migration(set_null: true) %> <% else %> # column <%= fk.from_column %> can't be set to null <%= fk.to_zombie.migration %> <% end %> end end <%= fk.migration %> <% end %> end end