I was assuming that I was using a deprecated methodology from an old
tutorial and that “rake db:migrate_plugins” was the correct way to run
the
migration of an engine. Since I know now its not, I’m still stumped as
to
why this doesn’t work. When I use “script/generate plugin_migration”,
it
generates the file 087_project_rank_to_version_1.rb, which in turn runs
the
migration for the “project_rank” plugin. However if I do the following
rake db:migrate VERSION=86
it doesn’t drop my table, and my code for my single migration in my
plugin
is
def self.down
drop_table :project_ranks
end
I don’t understand why its not dropping the table, I don’t receive an
error,
even in verbose mode, but nothing happens with the table, it just
outputs
that its being reverted. If I manually delete the table, then run
rake db:migrate
after rolling back to version 86, I would expect it to create the table.
However, it does not create the table, and it doesn’t give me any
warnings.
It just displays a message that my plugin has been migrated. I thought
my
migration was pretty straight forward, but it just doesn’t work. Has
anyone
else had this problem? I’ve included my migration script below in case
I’ve
done something wrong I’m missing.
Thanks,
Todd
class CreateProjectRankTable < ActiveRecord::Migration
def self.up
create_table :project_ranks, :force => true do |t|
t.column “rank”, :integer
t.column “project_id”, :integer
end
add_index "project_ranks", ["project_id"], :name =>
“project_ranks_project_id”
add_index “project_ranks”, [“rank”], :name => “project_ranks_rank”
end
def self.down
drop_table :project_ranks
end
end