I generated a migration that adds a column called encrypted_password to the users table present in my databse. This was generated automatically by rails using the command:
rails generate migration add_password_to_users encrypted_password:string
class AddPasswordToUsers < ActiveRecord::Migration
def self.up
add_column :users, :encrypted_password, :string
end
def self.down
remove_column :users, :encrypted_password
end
end
I'm trying to remove and remake the encrypted_password column in the users_table, so this is what I'm doing:
rake db:migrate:down VERSION=20110712172013
(thats the timestamp of the migration)
rake db:migrate
(Ive also tried rake db:migrate:redo VERSION=20110712172013
)
I get this error: SQLite3::SQLException: duplicate column name: encrypted_password: ALTER TABLE "users" ADD "encrypted_password" varchar(255)
So for some reason, the down migration isn't really removing the column. Anyone have an idea why?