Skip to content

Instantly share code, notes, and snippets.

@bonekost
Created March 6, 2019 07:42
Show Gist options
  • Save bonekost/ceb299bdf54545b5fe46832b2691e716 to your computer and use it in GitHub Desktop.
Save bonekost/ceb299bdf54545b5fe46832b2691e716 to your computer and use it in GitHub Desktop.
Add migration release to all
Dir.glob('./db/migrate/*.rb') do |file|
text = File.read(file)
new_content = text.gsub(/< ActiveRecord::Migration/, "< ActiveRecord::Migration[4.2]")
File.open(file, "w") {|f| f.puts new_content }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment