heroku run db:migrate を実行すると
StandardError: An error has occurred, this and all later migrations canceled: PG::UndefinedTable: ERROR: relation "users" does not exist : ALTER TABLE "users" ADD "course" character varying
という感じでtableが存在しないいうことなので、先駆者たちの知恵を参考にマイグレーションファイルの名前を変更したのですが、ダメでした、、、
$ heroku pg:psqlをし、\dでテーブルを確認したところ
List of relations
Schema | Name | Type | Owner
--------+-------------------+----------+----------------
public | logs | table | btzdggbatveezf
public | logs_id_seq | sequence | btzdggbatveezf
public | schema_migrations | table | btzdggbatveezf
users テーブルどころか 色々足りてないことがわかりましたが原因がわかりません
下記 スキーマ
ActiveRecord::Schema.define(version: 20170508060806) do add_index "admins", ["email"], name: "index_admins_on_email", unique: true, using: :btree add_index "admins", ["reset_password_token"], name: "index_admins_on_reset_password_token", unique: true, using: :btree create_table "fileadds", force: :cascade do |t| t.string "name", limit: 255 t.binary "data", limit: 65535 t.datetime "created_at" t.datetime "updated_at" end create_table "logs", force: :cascade do |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "movies", force: :cascade do |t| t.string "thumbnail", limit: 255 t.string "movie_file", limit: 255 t.text "comment", limit: 65535 t.datetime "created_at" t.datetime "updated_at" t.string "movtit", limit: 255 end create_table "pv1s", force: :cascade do |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "takes", force: :cascade do |t| t.binary "book", limit: 65535 t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "filename", limit: 255 t.integer "userid", limit: 4 end create_table "users", force: :cascade do |t| t.string "email", limit: 255, default: "", null: false t.string "encrypted_password", limit: 255, default: "", null: false t.string "reset_password_token", limit: 255 t.datetime "reset_password_sent_at" t.datetime "remember_created_at" t.integer "sign_in_count", limit: 4, default: 0, null: false t.datetime "current_sign_in_at" t.datetime "last_sign_in_at" t.string "current_sign_in_ip", limit: 255 t.string "last_sign_in_ip", limit: 255 t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "course", limit: 255 t.string "fullname", limit: 255 t.string "div", limit: 255 t.string "Upload_filename", limit: 255 t.binary "Upload_file", limit: 65535 t.integer "admin", limit: 4 t.integer "year", limit: 4 t.integer "month", limit: 4 t.integer "day", limit: 4 t.string "portrait", limit: 255 t.string "image", limit: 255 t.string "education", limit: 255 t.string "work", limit: 255 t.text "other", limit: 65535 t.string "idea", limit: 255 t.string "vision", limit: 255 t.string "mission", limit: 255 end add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree end
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。