-
-
Save ruby-fu-ninja/bb52c3c473a18e8961a0 to your computer and use it in GitHub Desktop.
Set all migrations as up in schema_migrations table
This file contains hidden or 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
Dir["db/migrate/*"].each do |v| | |
next if v == "." or v == ".." or v == ".svn" | |
version = File.basename(v).split('_').first | |
begin | |
ActiveRecord::Base.connection.execute("INSERT INTO schema_migrations values ('#{version}')") | |
rescue => e | |
p e | |
exit | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment