Last active
April 19, 2016 01:38
-
-
Save conorh/e31b9a7e1e197b68ea01215473b88ab0 to your computer and use it in GitHub Desktop.
Cleanup structure.sql file after it is created
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
Rake::Task["db:structure:dump"].enhance do | |
path = Rails.root.join('db', 'structure.sql') | |
file = File.read(path) | |
file.gsub!(/ AUTO_INCREMENT=\d*/, '') | |
# remove all comment lines | |
file.gsub!(/^--.*/,'') | |
File.write(path, file) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment