0

I recently tested the Queue_Classic gem in my app. Part of the setup is running this migration:

require 'queue_classic'

class AddQueueClassic < ActiveRecord::Migration
  def self.up
    QC::Setup.create
  end

  def self.down
    QC::Setup.drop
  end
end

Now I'd like to switch to a different queueing system, but I'm afraid that I won't be able to remove queue_classic from the Gemfile. Even if I generate a migration that just runs:

drop_table :queue_classic_jobs

Won't rake db:migrate still complain when it sees the first instance of require 'queue_classic' and QC::Setup.create but can't find the queue_classic gem?

mattangriffel
  • 819
  • 1
  • 7
  • 18
  • 1
    There's nothing wrong with editing or deleting old migrations, they're meant to be temporary helpers, they're not a permanent part of your application. – mu is too short Jun 14 '13 at 02:10

2 Answers2

1

yeah, that is true. that's the case why, at some point, you just get rid of old migrations and use the schema.rb http://adventuresincoding.com/2010/02/how-to-clean-up-your-activerecord-migrations

phoet
  • 18,688
  • 4
  • 46
  • 74
1

Create the migration to do QC::Setup.drop and run it.

Then delete the original AddQueueClassic migration altogether.

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497