質問編集履歴

2

書式

2020/06/20 08:35

投稿

Tomato_leaf
Tomato_leaf

スコア173

test CHANGED
File without changes
test CHANGED
@@ -393,3 +393,59 @@
393
393
  ec2-user:~/environment/randomtag (master) $
394
394
 
395
395
  ```
396
+
397
+
398
+
399
+ ### 追記2
400
+
401
+
402
+
403
+ db/schema.rb
404
+
405
+ ```ここに言語を入力
406
+
407
+ ActiveRecord::Schema.define(version: 2020_06_18_121655) do
408
+
409
+
410
+
411
+ create_table "hashtags", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
412
+
413
+ t.string "content"
414
+
415
+ t.bigint "user_id"
416
+
417
+ t.datetime "created_at", null: false
418
+
419
+ t.datetime "updated_at", null: false
420
+
421
+ t.index ["user_id"], name: "index_hashtags_on_user_id"
422
+
423
+ end
424
+
425
+
426
+
427
+ create_table "users", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
428
+
429
+ t.string "name"
430
+
431
+ t.string "email"
432
+
433
+ t.string "password_digest"
434
+
435
+ t.datetime "created_at", null: false
436
+
437
+ t.datetime "updated_at", null: false
438
+
439
+ t.string "reset_digest"
440
+
441
+ t.datetime "reset_sent_at"
442
+
443
+ end
444
+
445
+
446
+
447
+ add_foreign_key "hashtags", "users"
448
+
449
+ end
450
+
451
+ ```

1

書式

2020/06/20 08:35

投稿

Tomato_leaf
Tomato_leaf

スコア173

test CHANGED
File without changes
test CHANGED
@@ -359,3 +359,37 @@
359
359
  end
360
360
 
361
361
  ```
362
+
363
+
364
+
365
+ ### 追記
366
+
367
+ マイグレーションに失敗しているのかなと思い
368
+
369
+ heroku run rake db:migrateのコマンドを実行した後、
370
+
371
+ アプリを立ち上げてみましたが結果は変わらずでした。
372
+
373
+
374
+
375
+ ```ここに言語を入力
376
+
377
+ ec2-user:~/environment/randomtag (master) $ heroku run rake db:migrate
378
+
379
+ Running rake db:migrate on ⬢ randomtag... up, run.9196 (Free)
380
+
381
+ D, [2020-06-19T21:57:26.831193 #4] DEBUG -- : (4.0ms) SELECT pg_try_advisory_lock(5483695990905341160)
382
+
383
+ D, [2020-06-19T21:57:26.901984 #4] DEBUG -- : (3.6ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
384
+
385
+ D, [2020-06-19T21:57:26.931595 #4] DEBUG -- : ActiveRecord::InternalMetadata Load (1.6ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = $1 LIMIT $2 [["key", "environment"], ["LIMIT", 1]]
386
+
387
+ D, [2020-06-19T21:57:26.961387 #4] DEBUG -- : (1.2ms) BEGIN
388
+
389
+ D, [2020-06-19T21:57:26.963787 #4] DEBUG -- : (1.0ms) COMMIT
390
+
391
+ D, [2020-06-19T21:57:26.965204 #4] DEBUG -- : (1.2ms) SELECT pg_advisory_unlock(5483695990905341160)
392
+
393
+ ec2-user:~/environment/randomtag (master) $
394
+
395
+ ```