yunyun_engineer
@yunyun_engineer (yunyun)

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

HEROKUでseedファイルのデータを反映できません。

Q&A

Closed

解決したいこと

HEROKUでseedファイルのデータを反映できません。

heroku run DISABLE_DATABASE_ENVIRONMENT_CHECK=1 rails db:drop db:create db:migrate db:seed

上記のコマンドを実行しましたがターミナルにて下記のエラーがでます
解決の方法を知りたいです。

発生している問題・エラー

Running DISABLE_DATABASE_ENVIRONMENT_CHECK=1 rails db:drop db:create db:migrate db:seed on ⬢ fridge-app-35190... up, run.8309 (Free)
D, [2021-04-23T11:10:09.582316 #4] DEBUG -- :    (3.0ms)  SET NAMES utf8,  @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'),  @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
D, [2021-04-23T11:10:09.679597 #4] DEBUG -- :    (93.1ms)  DROP DATABASE IF EXISTS `heroku_dbb35446b4278db`
Dropped database 'heroku_dbb35446b4278db'
D, [2021-04-23T11:10:09.741645 #4] DEBUG -- :    (2.4ms)  SET NAMES utf8,  @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'),  @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
D, [2021-04-23T11:10:09.749412 #4] DEBUG -- :    (5.2ms)  CREATE DATABASE `heroku_dbb35446b4278db` DEFAULT CHARACTER SET `utf8`
Created database 'heroku_dbb35446b4278db'
D, [2021-04-23T11:10:09.784916 #4] DEBUG -- :    (1.4ms)  SET NAMES utf8,  @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'),  @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
D, [2021-04-23T11:10:09.797891 #4] DEBUG -- :    (1.9ms)  SELECT @@innodb_file_per_table = 1 AND @@innodb_file_format = 'Barracuda'
D, [2021-04-23T11:10:09.824016 #4] DEBUG -- :    (25.5ms)  CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL PRIMARY KEY) ROW_FORMAT=DYNAMIC
D, [2021-04-23T11:10:09.849274 #4] DEBUG -- :    (19.6ms)  CREATE TABLE `ar_internal_metadata` (`key` varchar(255) NOT NULL PRIMARY KEY, `value` varchar(255), `created_at` datetime(6) NOT NULL, `updated_at` datetime(6) NOT NULL) ROW_FORMAT=DYNAMIC
D, [2021-04-23T11:10:09.905672 #4] DEBUG -- :    (2.6ms)  SET NAMES utf8,  @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'),  @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
D, [2021-04-23T11:10:09.913971 #4] DEBUG -- :    (3.9ms)  SELECT GET_LOCK('2243929363994892210', 0)
D, [2021-04-23T11:10:09.935103 #4] DEBUG -- :    (3.3ms)  SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC
I, [2021-04-23T11:10:09.974354 #4]  INFO -- : Migrating to DeviseCreateUsers (20210415073953)
== 20210415073953 DeviseCreateUsers: migrating ================================
-- create_table(:users)
D, [2021-04-23T11:10:10.034379 #4] DEBUG -- :    (33.1ms)  CREATE TABLE `users` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `nickname` varchar(255) NOT NULL, `email` varchar(255) DEFAULT '' NOT NULL, `encrypted_password` varchar(255) DEFAULT '' NOT NULL, `reset_password_token` varchar(255), `reset_password_sent_at` datetime, `remember_created_at` datetime, `created_at` datetime(6) NOT NULL, `updated_at` datetime(6) NOT NULL) ROW_FORMAT=DYNAMIC
   -> 0.0348s
-- add_index(:users, :email, {:unique=>true})
D, [2021-04-23T11:10:10.069564 #4] DEBUG -- :    (27.4ms)  CREATE UNIQUE INDEX `index_users_on_email`  ON `users` (`email`) 
   -> 0.0350s
-- add_index(:users, :reset_password_token, {:unique=>true})
D, [2021-04-23T11:10:10.099299 #4] DEBUG -- :    (23.0ms)  CREATE UNIQUE INDEX `index_users_on_reset_password_token`  ON `users` (`reset_password_token`) 
   -> 0.0297s
== 20210415073953 DeviseCreateUsers: migrated (0.1000s) =======================

D, [2021-04-23T11:10:10.112462 #4] DEBUG -- :    (1.4ms)  BEGIN
D, [2021-04-23T11:10:10.114076 #4] DEBUG -- :   primary::SchemaMigration Create (1.4ms)  INSERT INTO `schema_migrations` (`version`) VALUES ('20210415073953')
D, [2021-04-23T11:10:10.121897 #4] DEBUG -- :    (7.5ms)  COMMIT
I, [2021-04-23T11:10:10.122041 #4]  INFO -- : Migrating to CreateSnsCredentials (20210416024015)
== 20210416024015 CreateSnsCredentials: migrating =============================
-- create_table(:sns_credentials)
D, [2021-04-23T11:10:10.152493 #4] DEBUG -- :    (26.5ms)  CREATE TABLE `sns_credentials` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `provider` varchar(255), `uid` varchar(255), `user_id` bigint, `created_at` datetime(6) NOT NULL, `updated_at` datetime(6) NOT NULL,  INDEX `index_sns_credentials_on_user_id`  (`user_id`), CONSTRAINT `fk_rails_c5d66654bc`
FOREIGN KEY (`user_id`)
  REFERENCES `users` (`id`)
) ROW_FORMAT=DYNAMIC
   -> 0.0297s
== 20210416024015 CreateSnsCredentials: migrated (0.0299s) ====================

D, [2021-04-23T11:10:10.157366 #4] DEBUG -- :    (3.6ms)  BEGIN
D, [2021-04-23T11:10:10.159043 #4] DEBUG -- :   primary::SchemaMigration Create (1.4ms)  INSERT INTO `schema_migrations` (`version`) VALUES ('20210416024015')
D, [2021-04-23T11:10:10.166171 #4] DEBUG -- :    (6.8ms)  COMMIT
I, [2021-04-23T11:10:10.166378 #4]  INFO -- : Migrating to CreateItems (20210416123350)
== 20210416123350 CreateItems: migrating ======================================
-- create_table(:items)
D, [2021-04-23T11:10:10.200671 #4] DEBUG -- :    (25.8ms)  CREATE TABLE `items` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(255) NOT NULL, `quantity` int NOT NULL, `purchase_date` date NOT NULL, `expiration_date` date NOT NULL, `memo` text, `user_id` bigint, `created_at` datetime(6) NOT NULL, `updated_at` datetime(6) NOT NULL,  INDEX `index_items_on_user_id`  (`user_id`), CONSTRAINT `fk_rails_d4b6334db2`
FOREIGN KEY (`user_id`)
  REFERENCES `users` (`id`)
) ROW_FORMAT=DYNAMIC
   -> 0.0333s
== 20210416123350 CreateItems: migrated (0.0334s) =============================

D, [2021-04-23T11:10:10.203339 #4] DEBUG -- :    (1.4ms)  BEGIN
D, [2021-04-23T11:10:10.204897 #4] DEBUG -- :   primary::SchemaMigration Create (1.3ms)  INSERT INTO `schema_migrations` (`version`) VALUES ('20210416123350')
D, [2021-04-23T11:10:10.211397 #4] DEBUG -- :    (6.1ms)  COMMIT
I, [2021-04-23T11:10:10.211604 #4]  INFO -- : Migrating to CreateActiveStorageTables (20210417011138)
== 20210417011138 CreateActiveStorageTables: migrating ========================
-- create_table(:active_storage_blobs, {})
D, [2021-04-23T11:10:10.248673 #4] DEBUG -- :    (32.8ms)  CREATE TABLE `active_storage_blobs` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `key` varchar(255) NOT NULL, `filename` varchar(255) NOT NULL, `content_type` varchar(255), `metadata` text, `byte_size` bigint NOT NULL, `checksum` varchar(255) NOT NULL, `created_at` datetime NOT NULL, UNIQUE INDEX `index_active_storage_blobs_on_key`  (`key`)) ROW_FORMAT=DYNAMIC
   -> 0.0359s
-- create_table(:active_storage_attachments, {})
D, [2021-04-23T11:10:10.285658 #4] DEBUG -- :    (32.2ms)  CREATE TABLE `active_storage_attachments` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(255) NOT NULL, `record_type` varchar(255) NOT NULL, `record_id` bigint NOT NULL, `blob_id` bigint NOT NULL, `created_at` datetime NOT NULL,  INDEX `index_active_storage_attachments_on_blob_id`  (`blob_id`), UNIQUE INDEX `index_active_storage_attachments_uniqueness`  (`record_type`, `record_id`, `name`, `blob_id`), CONSTRAINT `fk_rails_c3b3935057`
FOREIGN KEY (`blob_id`)
  REFERENCES `active_storage_blobs` (`id`)
) ROW_FORMAT=DYNAMIC
   -> 0.0369s
== 20210417011138 CreateActiveStorageTables: migrated (0.0730s) ===============

D, [2021-04-23T11:10:10.288569 #4] DEBUG -- :    (1.7ms)  BEGIN
D, [2021-04-23T11:10:10.290586 #4] DEBUG -- :   primary::SchemaMigration Create (1.8ms)  INSERT INTO `schema_migrations` (`version`) VALUES ('20210417011138')
D, [2021-04-23T11:10:10.298809 #4] DEBUG -- :    (7.9ms)  COMMIT
I, [2021-04-23T11:10:10.299080 #4]  INFO -- : Migrating to CreateCategories (20210420085905)
== 20210420085905 CreateCategories: migrating =================================
-- create_table(:categories)
D, [2021-04-23T11:10:10.323835 #4] DEBUG -- :    (23.2ms)  CREATE TABLE `categories` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(255) NOT NULL, `created_at` datetime(6) NOT NULL, `updated_at` datetime(6) NOT NULL) ROW_FORMAT=DYNAMIC
   -> 0.0240s
== 20210420085905 CreateCategories: migrated (0.0241s) ========================

D, [2021-04-23T11:10:10.326340 #4] DEBUG -- :    (1.5ms)  BEGIN
D, [2021-04-23T11:10:10.327988 #4] DEBUG -- :   primary::SchemaMigration Create (1.4ms)  INSERT INTO `schema_migrations` (`version`) VALUES ('20210420085905')
D, [2021-04-23T11:10:10.335417 #4] DEBUG -- :    (7.1ms)  COMMIT
I, [2021-04-23T11:10:10.335560 #4]  INFO -- : Migrating to CreateProducts (20210420085923)
== 20210420085923 CreateProducts: migrating ===================================
-- create_table(:products)
D, [2021-04-23T11:10:10.366735 #4] DEBUG -- :    (27.7ms)  CREATE TABLE `products` (`id` bigint NOT NULL AUTO_INCREMENT PRIMARY KEY, `name` varchar(255) NOT NULL, `shelf_life` int NOT NULL, `frozen_life` int NOT NULL, `info` varchar(255), `category_id` bigint, `created_at` datetime(6) NOT NULL, `updated_at` datetime(6) NOT NULL,  INDEX `index_products_on_category_id`  (`category_id`), CONSTRAINT `fk_rails_fb915499a4`
FOREIGN KEY (`category_id`)
  REFERENCES `categories` (`id`)
) ROW_FORMAT=DYNAMIC
   -> 0.0304s
== 20210420085923 CreateProducts: migrated (0.0305s) ==========================

D, [2021-04-23T11:10:10.369179 #4] DEBUG -- :    (1.4ms)  BEGIN
D, [2021-04-23T11:10:10.370795 #4] DEBUG -- :   primary::SchemaMigration Create (1.4ms)  INSERT INTO `schema_migrations` (`version`) VALUES ('20210420085923')
D, [2021-04-23T11:10:10.376365 #4] DEBUG -- :    (5.3ms)  COMMIT
D, [2021-04-23T11:10:10.387005 #4] DEBUG -- :   ActiveRecord::InternalMetadata Load (1.6ms)  SELECT `ar_internal_metadata`.* FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment' LIMIT 1
D, [2021-04-23T11:10:10.398560 #4] DEBUG -- :    (1.8ms)  BEGIN
D, [2021-04-23T11:10:10.400929 #4] DEBUG -- :   ActiveRecord::InternalMetadata Create (2.2ms)  INSERT INTO `ar_internal_metadata` (`key`, `value`, `created_at`, `updated_at`) VALUES ('environment', 'production', '2021-04-23 11:10:10.395635', '2021-04-23 11:10:10.395635')
D, [2021-04-23T11:10:10.407200 #4] DEBUG -- :    (6.0ms)  COMMIT
D, [2021-04-23T11:10:10.409680 #4] DEBUG -- :    (2.3ms)  SELECT RELEASE_LOCK('2243929363994892210')
D, [2021-04-23T11:10:10.441237 #4] DEBUG -- :    (1.4ms)  SET NAMES utf8,  @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'),  @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
D, [2021-04-23T11:10:10.451793 #4] DEBUG -- :    (1.5ms)  SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC
D, [2021-04-23T11:10:10.489615 #4] DEBUG -- :    (2.3ms)  SET NAMES utf8,  @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'),  @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
D, [2021-04-23T11:10:10.513387 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:10.516046 #4] DEBUG -- :   Category Create (2.4ms)  INSERT INTO `categories` (`name`, `created_at`, `updated_at`) VALUES ('野菜', '2021-04-23 11:10:10.510199', '2021-04-23 11:10:10.510199')
D, [2021-04-23T11:10:10.523602 #4] DEBUG -- :    (7.2ms)  COMMIT
D, [2021-04-23T11:10:10.526938 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:10.529381 #4] DEBUG -- :   Category Create (2.3ms)  INSERT INTO `categories` (`name`, `created_at`, `updated_at`) VALUES ('果物', '2021-04-23 11:10:10.524059', '2021-04-23 11:10:10.524059')
D, [2021-04-23T11:10:10.537016 #4] DEBUG -- :    (7.3ms)  COMMIT
D, [2021-04-23T11:10:10.540396 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:10.543055 #4] DEBUG -- :   Category Create (2.5ms)  INSERT INTO `categories` (`name`, `created_at`, `updated_at`) VALUES ('きのこ類', '2021-04-23 11:10:10.537477', '2021-04-23 11:10:10.537477')
D, [2021-04-23T11:10:10.550097 #4] DEBUG -- :    (6.6ms)  COMMIT
D, [2021-04-23T11:10:10.588997 #4] DEBUG -- :    (2.4ms)  BEGIN
D, [2021-04-23T11:10:10.591665 #4] DEBUG -- :   Category Load (2.5ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.480729 #4] DEBUG -- :    (2.5ms)  ROLLBACK
D, [2021-04-23T11:10:11.484122 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.486682 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.490178 #4] DEBUG -- :    (2.4ms)  ROLLBACK
D, [2021-04-23T11:10:11.493419 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:11.496075 #4] DEBUG -- :   Category Load (2.5ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.499772 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.503261 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:11.505783 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.509628 #4] DEBUG -- :    (2.7ms)  ROLLBACK
D, [2021-04-23T11:10:11.512756 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.515211 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.518510 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:11.521687 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:11.524231 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.527442 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:11.530619 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:11.533007 #4] DEBUG -- :   Category Load (2.2ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.536240 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:11.539311 #4] DEBUG -- :    (2.1ms)  BEGIN
D, [2021-04-23T11:10:11.541720 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.545329 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:11.548802 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.551328 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.554661 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.557823 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.560286 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.563531 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:11.566656 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.569135 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.572426 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.575582 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.578183 #4] DEBUG -- :   Category Load (2.5ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.581780 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.584953 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.587360 #4] DEBUG -- :   Category Load (2.2ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.590630 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:11.593865 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.596467 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.601041 #4] DEBUG -- :    (3.4ms)  ROLLBACK
D, [2021-04-23T11:10:11.606545 #4] DEBUG -- :    (4.5ms)  BEGIN
D, [2021-04-23T11:10:11.609021 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.612422 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.616077 #4] DEBUG -- :    (2.4ms)  BEGIN
D, [2021-04-23T11:10:11.618615 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.622608 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.626129 #4] DEBUG -- :    (2.5ms)  BEGIN
D, [2021-04-23T11:10:11.628717 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.632487 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.635734 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.638306 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.641610 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:11.644779 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.647355 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.650674 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.653850 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:11.656308 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.659570 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.662731 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.665142 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.668342 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:11.671918 #4] DEBUG -- :    (2.4ms)  BEGIN
D, [2021-04-23T11:10:11.674640 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.677976 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:11.681406 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.683994 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.687724 #4] DEBUG -- :    (2.4ms)  ROLLBACK
D, [2021-04-23T11:10:11.690875 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.693338 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.696712 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:11.699938 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.702408 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.706020 #4] DEBUG -- :    (2.5ms)  ROLLBACK
D, [2021-04-23T11:10:11.712079 #4] DEBUG -- :    (4.4ms)  BEGIN
D, [2021-04-23T11:10:11.714595 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.718203 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.721665 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:11.724387 #4] DEBUG -- :   Category Load (2.5ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.729343 #4] DEBUG -- :    (2.4ms)  ROLLBACK
D, [2021-04-23T11:10:11.732963 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:11.735619 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.739873 #4] DEBUG -- :    (2.6ms)  ROLLBACK
D, [2021-04-23T11:10:11.743882 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:11.746842 #4] DEBUG -- :   Category Load (2.7ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.750447 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:11.753934 #4] DEBUG -- :    (2.4ms)  BEGIN
D, [2021-04-23T11:10:11.757241 #4] DEBUG -- :   Category Load (3.0ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.760870 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.764043 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.766750 #4] DEBUG -- :   Category Load (2.5ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.770281 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.774111 #4] DEBUG -- :    (2.4ms)  BEGIN
D, [2021-04-23T11:10:11.776800 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.781649 #4] DEBUG -- :    (3.1ms)  ROLLBACK
D, [2021-04-23T11:10:11.785363 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:11.787853 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.791716 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.795513 #4] DEBUG -- :    (2.4ms)  BEGIN
D, [2021-04-23T11:10:11.798082 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.802247 #4] DEBUG -- :    (2.4ms)  ROLLBACK
D, [2021-04-23T11:10:11.806365 #4] DEBUG -- :    (2.8ms)  BEGIN
D, [2021-04-23T11:10:11.808842 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.812325 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:11.815773 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.818522 #4] DEBUG -- :   Category Load (2.6ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.823462 #4] DEBUG -- :    (2.5ms)  ROLLBACK
D, [2021-04-23T11:10:11.827855 #4] DEBUG -- :    (2.5ms)  BEGIN
D, [2021-04-23T11:10:11.830740 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.834573 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.837789 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.840299 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.844540 #4] DEBUG -- :    (2.6ms)  ROLLBACK
D, [2021-04-23T11:10:11.848223 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:11.850820 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.854449 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.857652 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:11.860147 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.863478 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.866787 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:11.869357 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.872775 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:11.876016 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.878541 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.882343 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.886326 #4] DEBUG -- :    (2.5ms)  BEGIN
D, [2021-04-23T11:10:11.888914 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.892371 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.896510 #4] DEBUG -- :    (2.5ms)  BEGIN
D, [2021-04-23T11:10:11.899746 #4] DEBUG -- :   Category Load (2.9ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 1 LIMIT 1
D, [2021-04-23T11:10:11.903683 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.907474 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:11.910202 #4] DEBUG -- :   Category Load (2.5ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:11.914263 #4] DEBUG -- :    (2.4ms)  ROLLBACK
D, [2021-04-23T11:10:11.918037 #4] DEBUG -- :    (2.4ms)  BEGIN
D, [2021-04-23T11:10:11.920702 #4] DEBUG -- :   Category Load (2.5ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:11.925097 #4] DEBUG -- :    (3.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.929825 #4] DEBUG -- :    (3.4ms)  BEGIN
D, [2021-04-23T11:10:11.932469 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:11.936579 #4] DEBUG -- :    (2.5ms)  ROLLBACK
D, [2021-04-23T11:10:11.940080 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.942846 #4] DEBUG -- :   Category Load (2.6ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:11.946729 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.950166 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.952713 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:11.956516 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.960069 #4] DEBUG -- :    (2.4ms)  BEGIN
D, [2021-04-23T11:10:11.963009 #4] DEBUG -- :   Category Load (2.8ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:11.966776 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:11.970295 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.972809 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:11.976217 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:11.979393 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:11.981860 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:11.988556 #4] DEBUG -- :    (4.9ms)  ROLLBACK
D, [2021-04-23T11:10:11.992357 #4] DEBUG -- :    (2.4ms)  BEGIN
D, [2021-04-23T11:10:11.994803 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:11.998043 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:12.001429 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:12.004240 #4] DEBUG -- :   Category Load (2.5ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:12.009000 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:12.012586 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:12.015134 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:12.019155 #4] DEBUG -- :    (2.4ms)  ROLLBACK
D, [2021-04-23T11:10:12.022700 #4] DEBUG -- :    (2.2ms)  BEGIN
D, [2021-04-23T11:10:12.025198 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:12.029012 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:12.032412 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:12.034878 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:12.038263 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:12.042032 #4] DEBUG -- :    (2.7ms)  BEGIN
D, [2021-04-23T11:10:12.045746 #4] DEBUG -- :   Category Load (3.0ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:12.053886 #4] DEBUG -- :    (2.5ms)  ROLLBACK
D, [2021-04-23T11:10:12.058007 #4] DEBUG -- :    (2.7ms)  BEGIN
D, [2021-04-23T11:10:12.061281 #4] DEBUG -- :   Category Load (2.9ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:12.071861 #4] DEBUG -- :    (2.6ms)  ROLLBACK
D, [2021-04-23T11:10:12.078447 #4] DEBUG -- :    (3.1ms)  BEGIN
D, [2021-04-23T11:10:12.082259 #4] DEBUG -- :   Category Load (2.6ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:12.088556 #4] DEBUG -- :    (4.2ms)  ROLLBACK
D, [2021-04-23T11:10:12.096290 #4] DEBUG -- :    (2.9ms)  BEGIN
D, [2021-04-23T11:10:12.099813 #4] DEBUG -- :   Category Load (3.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:12.105037 #4] DEBUG -- :    (3.6ms)  ROLLBACK
D, [2021-04-23T11:10:12.110565 #4] DEBUG -- :    (4.2ms)  BEGIN
D, [2021-04-23T11:10:12.115098 #4] DEBUG -- :   Category Load (4.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:12.119953 #4] DEBUG -- :    (3.2ms)  ROLLBACK
D, [2021-04-23T11:10:12.125381 #4] DEBUG -- :    (4.1ms)  BEGIN
D, [2021-04-23T11:10:12.128865 #4] DEBUG -- :   Category Load (3.2ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:12.133838 #4] DEBUG -- :    (3.1ms)  ROLLBACK
D, [2021-04-23T11:10:12.138909 #4] DEBUG -- :    (3.6ms)  BEGIN
D, [2021-04-23T11:10:12.142712 #4] DEBUG -- :   Category Load (3.6ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 2 LIMIT 1
D, [2021-04-23T11:10:12.147595 #4] DEBUG -- :    (3.6ms)  ROLLBACK
D, [2021-04-23T11:10:12.151979 #4] DEBUG -- :    (2.9ms)  BEGIN
D, [2021-04-23T11:10:12.154853 #4] DEBUG -- :   Category Load (2.6ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 3 LIMIT 1
D, [2021-04-23T11:10:12.159214 #4] DEBUG -- :    (2.6ms)  ROLLBACK
D, [2021-04-23T11:10:12.163722 #4] DEBUG -- :    (3.1ms)  BEGIN
D, [2021-04-23T11:10:12.166345 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 3 LIMIT 1
D, [2021-04-23T11:10:12.170466 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:12.174258 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:12.176792 #4] DEBUG -- :   Category Load (2.3ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 3 LIMIT 1
D, [2021-04-23T11:10:12.180845 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:12.184666 #4] DEBUG -- :    (2.3ms)  BEGIN
D, [2021-04-23T11:10:12.187320 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 3 LIMIT 1
D, [2021-04-23T11:10:12.190745 #4] DEBUG -- :    (2.2ms)  ROLLBACK
D, [2021-04-23T11:10:12.196828 #4] DEBUG -- :    (4.3ms)  BEGIN
D, [2021-04-23T11:10:12.199494 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 3 LIMIT 1
D, [2021-04-23T11:10:12.203629 #4] DEBUG -- :    (2.3ms)  ROLLBACK
D, [2021-04-23T11:10:12.210512 #4] DEBUG -- :    (5.6ms)  BEGIN
D, [2021-04-23T11:10:12.213884 #4] DEBUG -- :   Category Load (3.0ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 3 LIMIT 1
D, [2021-04-23T11:10:12.219646 #4] DEBUG -- :    (3.2ms)  ROLLBACK
D, [2021-04-23T11:10:12.225162 #4] DEBUG -- :    (3.4ms)  BEGIN
D, [2021-04-23T11:10:12.227994 #4] DEBUG -- :   Category Load (2.4ms)  SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 3 LIMIT 1
D, [2021-04-23T11:10:12.232609 #4] DEBUG -- :    (2.4ms)  ROLLBACK

0

1Answer

ローカルではエラーなく動いている状態でしょうか?

db:seed の前の db:migrate でエラーが起きているように思えるのですが。

0Like

Comments

  1. ローカル環境では問題なく動いております。
  2. まずは heroku 側で db:migrate がエラーになっているのか確認して( db:seed 無しで実行してエラーが起きれば、 db:migrate が原因)、ローカルで正常だけど、heroku でエラーとなるマイグレーションの書き方などがあるか見直す感じでしょうか。
  3. herokuでのdb:migrateは問題ありませんでした。

    ```
    Running rails db:migrate on ⬢ fridge-app-35190... up, run.3755 (Free)
    D, [2021-04-24T01:58:31.118975 #4] DEBUG -- : (2.2ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
    D, [2021-04-24T01:58:31.176657 #4] DEBUG -- : (3.3ms) SET NAMES utf8, @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'), @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
    D, [2021-04-24T01:58:31.183409 #4] DEBUG -- : (3.3ms) SELECT GET_LOCK('2243929363994892210', 0)
    D, [2021-04-24T01:58:31.199316 #4] DEBUG -- : (2.0ms) SELECT `schema_migrations`.`version` FROM `schema_migrations` ORDER BY `schema_migrations`.`version` ASC
    D, [2021-04-24T01:58:31.210501 #4] DEBUG -- : ActiveRecord::InternalMetadata Load (2.0ms) SELECT `ar_internal_metadata`.* FROM `ar_internal_metadata` WHERE `ar_internal_metadata`.`key` = 'environment' LIMIT 1
    D, [2021-04-24T01:58:31.222535 #4] DEBUG -- : (3.4ms) SELECT RELEASE_LOCK('2243929363994892210')
    ```
  4. そうだとすると db:seed のロジックに問題があると思うので、seed のロジックを見直すとよいと思います。

  5. コメントありがとうございます
    seedファイルも問題ないようです。

Your answer might help someone💌