The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Rake: db:migration:conflict

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jay Fields

Posts: 765
Nickname: jayfields
Registered: Sep, 2006

Jay Fields is a software developer for ThoughtWorks
Rake: db:migration:conflict Posted: Dec 21, 2006 7:09 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jay Fields.
Original Post: Rake: db:migration:conflict
Feed Title: Jay Fields Thoughts
Feed URL: http://blog.jayfields.com/rss.xml
Feed Description: Thoughts on Software Development
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jay Fields
Latest Posts From Jay Fields Thoughts

Advertisement
This task originally written by Stephen Chu.

If you are using migrations on a large team, migration conflicts can and do occur. To help avoid conflicts you can add the following task to your codebase and run it after updating and before checking in (hopefully in your commit task).
namespace :db do
namespace :migration do
desc "After downloading migrations from server, check to see if we have conflicting migration numbers."
task :conflict do
existing_migration_numbers = []
Dir.entries("#{RAILS_ROOT}/db/migrate").each do |entry|
migration_number = entry.scan(/^\d+/).first
next if migration_number.nil?
if existing_migration_numbers.include? migration_number
raise ArgumentError, "Migration #{migration_number} is already checked in on the server. Verify your migration numbers."
end
existing_migration_numbers << migration_number
end
end
end
end

Read: Rake: db:migration:conflict

Topic: New Ajax Feed Reader Previous Topic   Next Topic Topic: Rewriting a (large) PHP application in Rails, part 2

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use