Skip to content

Instantly share code, notes, and snippets.

@huyttq
Created February 13, 2012 04:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huyttq/1813644 to your computer and use it in GitHub Desktop.
Save huyttq/1813644 to your computer and use it in GitHub Desktop.
Zero downtime when migration
# http://blog.tstmedia.com/news_article/show/85364?referrer_id=308069
class << self
RemovedColumns = {'column_to_remove' => true}
def columns
cols = super
cols.reject { |col| RemovedColumns.has_key? col.name }
end
end
# http://pedro.herokuapp.com/past/2011/7/13/rails_migrations_with_no_downtime/
# www.engineyard.com/blog/2011/zero-downtime-deploys-with-migrations/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment