Rails 3.1.3
Hi. I thank you for your help all the time.
I had a table User (or I might have named ‘Users’ rather, but my
recollection is unclear). Since I chose to use devise rather than a
plain user table, I destroyed it.
rails destroy model user
After that, I simply installed and generated devise User, then
implemented migration
soichi% rake db:migrate
== DeviseCreateUsers: migrating
– create_table(:users)
rake aborted!
An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: table “users” already exists: CREATE TABLE
“users” (“id” INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, “email”
varchar(255) DEFAULT ‘’ NOT NULL, “encrypted_password” varchar(255)
DEFAULT ‘’ NOT NULL, “reset_password_token” varchar(255),
“reset_password_sent_at” datetime, “remember_created_at” datetime,
“sign_in_count” integer DEFAULT 0, “current_sign_in_at” datetime,
“last_sign_in_at” datetime, “current_sign_in_ip” varchar(255),
“last_sign_in_ip” varchar(255), “confirmation_token” varchar(255),
“confirmed_at” datetime, “confirmation_sent_at” datetime,
“unconfirmed_email” varchar(255), “username” varchar(255), “created_at”
datetime, “updated_at” datetime)
It says ‘users’ exists, so but rails destroy model users does not really
do anything. The problem I think was that the table was not properly
destroyed before devise was installed.
Certainly, schema.rb file has
create_table “users”, :force => true do |t|
t.integer “script_id”
t.string “username”
t.string “password”
t.string “email”
t.string “status”
t.datetime “created_at”
t.datetime “updated_at”
end
add_index “users”, [“script_id”], :name => “index_users_on_script_id”
I guess I need to change some files manually if any command is useless.
Could anyone help me out for completely destroying the old table?
Thanks in advance,
soichi