This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run from db/migrate to fix your old un-versioned migrations, so that they don't break on Rails 5.1 | |
Dir.glob('*').each do |migration| | |
versioned_migration = File.read(migration).gsub("< ActiveRecord::Migration\n", "< ActiveRecord::Migration[4.2]\n") | |
File.open(migration, 'w') do |output| | |
output << versioned_migration | |
end | |
end |