Remove MySQL AUTO_INCREMENT From Rails db:structure:dump
namespace :db do | |
namespace :structure do | |
task :dump => :environment do | |
# Can add more dump options to ~/.my.cnf: | |
# | |
# [mysqldump] | |
# skip-comments | |
# | |
command = %q{perl -i -pe's/AUTO_INCREMENT=\d+\s//' %s} % Rails.root.join("db/structure.sql") | |
sh command, :verbose => false do |ok, res| | |
abort "failed to remove AUTO_INCREMENT: #{res}" if !ok | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment