I read a lot about it but i still can't get rid of one table that I have in my db:
create_table "votes", force: true do |t|
t.integer "votable_id"
t.string "votable_type"
t.integer "voter_id"
t.string "voter_type"
t.boolean "vote_flag"
t.string "vote_scope"
t.integer "vote_weight"
t.datetime "created_at"
t.datetime "updated_at"
end
add_index "votes", ["votable_id", "votable_type", "vote_scope"],
name: "index_votes_on_votable_id_and_votable_type_and_vote_scope"
add_index "votes", ["voter_id", "voter_type", "vote_scope"],
name: "index_votes_on_voter_id_and_voter_type_and_vote_scope"
I don't have a migration that create this table. But I think this table comes from a previous installation of the acts_as_votable gem. But I might have deleted this migration manually...
I tried to drop_table as follows, but it's not working. Even if I have this migration file, the votes table is still there:
class DropVotesTable < ActiveRecord::Migration
def up
drop_table :votes
end
def down
raise ActiveRecord::IrreversibleMigration
end
end
What should I do to delete this table from my schema.rb file?
EDIT: solution
Even after running the migration the table was still in my schema.rb so I used the rails console:
rails c
ActiveRecord::Migration.drop_table(:votes)
rake db:migrate
And this table finally disappeared.