친구 요청 https://dankim.io/mutual-friendship-rails/을 구현하기 위해이 자습서를 따르고 첫 번째 단계 중 하나는 친구 테이블이 없어도 친구 참조로 우정 모델을 만드는 것입니다. 이것은 로컬에서 작동합니다. 전체 자습서를 따르고 모든 요청을 작성하고 수락 했으므로 이제 막 heroku로 푸시하려고 시도 할 때까지 아무런 문제가 없었습니다. 내가 얻는 오류는 PG :: UndefinedTable : ERROR : relation "friends"가 존재하지 않습니다.PG :: UndefinedTable : ERROR : relation "friends"가 존재하지 않습니다.
스키마 :
ActiveRecord::Schema.define(version: 20171217055455) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "comments", force: :cascade do |t|
t.bigint "post_id"
t.string "name"
t.string "body"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["post_id"], name: "index_comments_on_post_id"
end
create_table "friend_requests", force: :cascade do |t|
t.bigint "user_id"
t.bigint "friend_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["friend_id"], name: "index_friend_requests_on_friend_id"
t.index ["user_id"], name: "index_friend_requests_on_user_id"
end
create_table "friendships", force: :cascade do |t|
t.bigint "user_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "friend_id"
t.index ["friend_id"], name: "index_friendships_on_friend_id"
t.index ["user_id"], name: "index_friendships_on_user_id"
end
create_table "likes", force: :cascade do |t|
t.bigint "user_id"
t.bigint "post_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["post_id"], name: "index_likes_on_post_id"
t.index ["user_id"], name: "index_likes_on_user_id"
end
create_table "posts", force: :cascade do |t|
t.string "body"
t.bigint "user_id"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["user_id"], name: "index_posts_on_user_id"
end
create_table "users", force: :cascade do |t|
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.inet "current_sign_in_ip"
t.inet "last_sign_in_ip"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "name"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
create_table "votes", force: :cascade do |t|
t.string "votable_type"
t.bigint "votable_id"
t.string "voter_type"
t.bigint "voter_id"
t.boolean "vote_flag"
t.string "vote_scope"
t.integer "vote_weight"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["votable_id", "votable_type", "vote_scope"], name: "index_votes_on_votable_id_and_votable_type_and_vote_scope"
t.index ["votable_type", "votable_id"], name: "index_votes_on_votable_type_and_votable_id"
t.index ["voter_id", "voter_type", "vote_scope"], name: "index_votes_on_voter_id_and_voter_type_and_vote_scope"
t.index ["voter_type", "voter_id"], name: "index_votes_on_voter_type_and_voter_id"
end
add_foreign_key "comments", "posts"
add_foreign_key "friend_requests", "users"
add_foreign_key "friendships", "users"
add_foreign_key "likes", "posts"
add_foreign_key "likes", "users"
add_foreign_key "posts", "users"
end
마이그레이션을 Heroku에서 실행 했습니까? – Chris
예 heroku run rake db : migrate가 내게 오류를주었습니다. –