你好,我目前正在学习Rails并跟随教程。教程指导我在创建应用程序后编辑迁移文件,然后运行rake db:migrate和rake db:create。
我已将迁移文件编辑为以下内容:
class CreateUsers < ActiveRecord::Migration
def change
create_table :users do |t|
t.string :username
t.string :email
t.string :encrypted_password
t.string :salt
t.timestamps
end
end
end
当我运行 'rake db:migrate' 时,出现了错误。
Mysql2::Error: Table 'users' already exists: CREATE TABLE `users` ...
在我应该运行 'rake db:create' 之后,我得到了以下错误信息:
user_auth_development already exists
user_auth_test already exists