herokuを使用してRailsアプリをデプロイしようとしております。
herokuでアプリを作成して、下記の「git push heroku master」まで正常に行うことができました。
しかしherokuにデータベースを作る「heroku run rails db:migrate」を実行すると下記のようなエラーが出ました。
以前「logos」と「picture」のモデルを作成して削除したのですが、それが今回の原因になっていると考えております。
どのように処理すると正常になりますでしょうか?
あまり具体的に分析できていないため、情報が不足しているかもしれませんが何卒ご解説をいただけると幸いです。
よろしくお願いします。
› Warning: heroku update available from 7.38.0 to 7.42.5. Running rails db:migrate on ⬢ servicesimsearch... up, run.5273 (Free) (3.9ms) SELECT pg_try_advisory_lock(2649699517658720205) (1.7ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to AddServicesToLogos (20200607090401) (4.2ms) BEGIN == 20200607090401 AddServicesToLogos: migrating =============================== -- add_column(:logos, :picture, :string) (1.7ms) ALTER TABLE "logos" ADD "picture" character varying (1.2ms) ROLLBACK (2.0ms) SELECT pg_advisory_unlock(2649699517658720205) rails aborted! StandardError: An error has occurred, this and all later migrations canceled: PG::UndefinedTable: ERROR: relation "logos" does not exist : ALTER TABLE "logos" ADD "picture" character varying /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `async_exec' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels ) in execute' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execut e' 〜 〜 Caused by: PG::UndefinedTable: ERROR: relation "logos" does not exist /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `async_exec' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:75:in `block (2 levels ) in execute' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:74:in `block in execut e' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:581:in `block (2 levels) in log' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:580:in `block in log' /app/vendor/bundle/ruby/2.4.0/gems/activesupport-5.2.3/lib/active_support/notifications/instrumenter.rb:23:in `instrument' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract_adapter.rb:571:in `log' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/database_statements.rb:73:in `execute' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:581:in `add_column' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/postgresql/schema_statements.rb:420:in `add_column' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:871:in `block in method_missing' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:840:in `block in say_with_time' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:840:in `say_with_time' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:860:in `method_missing' /app/db/migrate/20200607090401_add_services_to_logos.rb:3:in `change' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:814:in `exec_migration' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:798:in `block (2 levels) in migrate' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:797:in `block in migrate' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:416:in `with_connection' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:796:in `migrate' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:977:in `migrate' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3/lib/active_record/migration.rb:1343:in `block in ddl_transaction' /app/vendor/bundle/ruby/2.4.0/gems/activerecord-5.2.3
あなたの回答
tips
プレビュー