这里还有另一个问题,试图不向许多人提问,而是把打上围墙。 滚动干.:与电站相距,并得出以下错误。 如何确定用户?
$ rake db:migrate
== CreateUsers: migrating ====================================================
-- create_table(:users)
NOTICE: CREATE TABLE will create implicit sequence "users_id_seq1" for serial column "users.id"
rake aborted!
An error has occurred, this and all later migrations canceled:
PGError: ERROR: relation "users" already exists
: CREATE TABLE "users" ("id" serial primary key, "first_name" character varying(25), "last_name" character varying(50), "email" character varying(255) DEFAULT NOT NULL, "password" character varying(40), "created_at" timestamp, "updated_at" timestamp)
Tasks: TOP => db:migrate
页: 1
class CreateUsers < ActiveRecord::Migration
def up
create_table :users do |t|
t.string "first_name", :limit => 25
t.string "last_name", :limit => 50
t.string "email", :default => "", :null => false
t.string "password", :limit => 40
t.timestamps
end
end
def down
drop_table :users
end
end