Open 39takagikouta opened 12 months ago
追記失礼します 特に残しておきたいデータもないので、rails db:dropしたのちに、マイグレーションファイルを全て削除することで、データベースを一から作り直すのが1番手っ取り早いかなと思ったのですが、どうでしょうか
PG::UndefinedColumn: ERROR: column "provider" of relation "users" does not exist
↑が関係しているログかと思われます。特に貴重なデータが入っているわけではないのなら、DBを破棄→作成→マイグレーションの手順で良いかと思います(ローカルで正しく挙動するかを確認した上で)
土屋講師、ご対応ありがとうございます! ご提示いただいた方法で解決することができました!
質問内容・実現したいこと 誤ってheroku postgresアドオンを削除してしまったため、再度アドオンを取得してheroku run rake db:migrateしたのだが、以前発生したトラブルのせいでエラーが出てしまう(下記参照)ので解決したいです。
現状発生している問題・エラーメッセージ
Running rake db:migrate on ⬢ warise... up, run.1864 (Eco) I, [2023-10-29T16:42:28.146328 #2] INFO -- : Migrating to DeviseCreateUsers (20231011154133) == 20231011154133 DeviseCreateUsers: migrating ================================ -- create_table(:users) -> 0.0079s -- add_index(:users, :email, {:unique=>true}) -> 0.0032s -- add_index(:users, :reset_password_token, {:unique=>true}) -> 0.0028s == 20231011154133 DeviseCreateUsers: migrated (0.0140s) =======================
I, [2023-10-29T16:42:28.168179 #2] INFO -- : Migrating to ChangeIsDisplayedDefaultInUsers (20231011161056) == 20231011161056 ChangeIsDisplayedDefaultInUsers: migrating ================== -- change_column_default(:users, :is_displayed, {:from=>nil, :to=>true}) -> 0.0049s == 20231011161056 ChangeIsDisplayedDefaultInUsers: migrated (0.0049s) =========
I, [2023-10-29T16:42:28.175616 #2] INFO -- : Migrating to CreateAlarms (20231012081009) == 20231012081009 CreateAlarms: migrating ===================================== -- create_table(:alarms) -> 0.0059s == 20231012081009 CreateAlarms: migrated (0.0059s) ============================
I, [2023-10-29T16:42:28.184495 #2] INFO -- : Migrating to CreateViewVideos (20231012125819) == 20231012125819 CreateViewVideos: migrating ================================= -- create_table(:view_videos) -> 0.0081s == 20231012125819 CreateViewVideos: migrated (0.0081s) ========================
I, [2023-10-29T16:42:28.195955 #2] INFO -- : Migrating to AddNameToUsers (20231014135448) == 20231014135448 AddNameToUsers: migrating =================================== -- add_column(:users, :name, :string) -> 0.0016s == 20231014135448 AddNameToUsers: migrated (0.0016s) ==========================
I, [2023-10-29T16:42:28.200449 #2] INFO -- : Migrating to ChangeNameToNotNullInUsers (20231014135702) == 20231014135702 ChangeNameToNotNullInUsers: migrating ======================= -- change_column(:users, :name, :string, {:null=>false}) -> 0.0020s == 20231014135702 ChangeNameToNotNullInUsers: migrated (0.0020s) ==============
I, [2023-10-29T16:42:28.205694 #2] INFO -- : Migrating to CreateComedyTags (20231015072839) == 20231015072839 CreateComedyTags: migrating ================================= -- create_table(:comedy_tags) -> 0.0078s -- add_index(:comedy_tags, :name, {:unique=>true}) -> 0.0026s == 20231015072839 CreateComedyTags: migrated (0.0105s) ========================
I, [2023-10-29T16:42:28.219147 #2] INFO -- : Migrating to CreateUserComedyTags (20231015073416) == 20231015073416 CreateUserComedyTags: migrating ============================= -- create_table(:user_comedy_tags) -> 0.0087s -- add_foreign_key(:user_comedy_tags, :users) -> 0.0041s -- add_foreign_key(:user_comedy_tags, :comedy_tags) -> 0.0026s -- add_index(:user_comedy_tags, [:user_id, :comedy_tag_id], {:unique=>true}) -> 0.0028s == 20231015073416 CreateUserComedyTags: migrated (0.0184s) ====================
I, [2023-10-29T16:42:28.240949 #2] INFO -- : Migrating to ModifyUserTables (20231015114403) == 20231015114403 ModifyUserTables: migrating ================================= -- change_column_null(:users, :is_displayed, false) -> 0.0016s == 20231015114403 ModifyUserTables: migrated (0.0016s) ========================
I, [2023-10-29T16:42:28.245471 #2] INFO -- : Migrating to CreateBootcamps (20231015115037) == 20231015115037 CreateBootcamps: migrating ================================== -- create_table(:bootcamps) -> 0.0065s == 20231015115037 CreateBootcamps: migrated (0.0065s) =========================
I, [2023-10-29T16:42:28.254731 #2] INFO -- : Migrating to ModifyAlarmsTable (20231015115156) == 20231015115156 ModifyAlarmsTable: migrating ================================ -- remove_column(:alarms, :user_id) -> 0.0016s -- add_reference(:alarms, :user, {:foreign_key=>true}) -> 0.0048s -- remove_column(:alarms, :bootcamp_id) -> 0.0009s -- add_reference(:alarms, :bootcamp, {:foreign_key=>true}) -> 0.0047s == 20231015115156 ModifyAlarmsTable: migrated (0.0122s) =======================
I, [2023-10-29T16:42:28.269860 #2] INFO -- : Migrating to ModifyViewVideosTable (20231015115554) == 20231015115554 ModifyViewVideosTable: migrating ============================ -- remove_column(:view_videos, :user_id) -> 0.0014s -- add_reference(:view_videos, :user, {:foreign_key=>true}) -> 0.0055s -- add_index(:view_videos, [:user_id, :video_url], {:unique=>true}) -> 0.0027s == 20231015115554 ModifyViewVideosTable: migrated (0.0097s) ===================
I, [2023-10-29T16:42:28.282144 #2] INFO -- : Migrating to ModifyUserComedyTagsTable (20231015115904) == 20231015115904 ModifyUserComedyTagsTable: migrating ======================== -- remove_foreign_key(:user_comedy_tags, :users) -> 0.0053s -- remove_foreign_key(:user_comedy_tags, :comedy_tags) -> 0.0040s -- remove_column(:user_comedy_tags, :user_id) -> 0.0009s -- add_reference(:user_comedy_tags, :user, {:foreign_key=>true}) -> 0.0051s -- remove_column(:user_comedy_tags, :comedy_tag_id) -> 0.0008s -- add_reference(:user_comedy_tags, :comedy_tag, {:foreign_key=>true}) -> 0.0046s -- add_index(:user_comedy_tags, [:user_id, :comedy_tag_id], {:unique=>true}) -> 0.0044s == 20231015115904 ModifyUserComedyTagsTable: migrated (0.0254s) ===============
I, [2023-10-29T16:42:28.317065 #2] INFO -- : Migrating to CreateKeywords (20231015130720) == 20231015130720 CreateKeywords: migrating =================================== -- create_table(:keywords) -> 0.0093s -- add_index(:keywords, [:user_id, :name], {:unique=>true}) -> 0.0025s == 20231015130720 CreateKeywords: migrated (0.0119s) ==========================
I, [2023-10-29T16:42:28.331830 #2] INFO -- : Migrating to ChangeDefaultValuesForVideoLengthInUsers (20231018182922) == 20231018182922 ChangeDefaultValuesForVideoLengthInUsers: migrating ========= -- change_column_default(:users, :min_video_length, 0) -> 0.0087s -- change_column_default(:users, :max_video_length, 3600) -> 0.0098s == 20231018182922 ChangeDefaultValuesForVideoLengthInUsers: migrated (0.0185s)
I, [2023-10-29T16:42:28.353605 #2] INFO -- : Migrating to RenameViewVideosToViewedVideos (20231023123047) == 20231023123047 RenameViewVideosToViewedVideos: migrating =================== -- rename_table(:view_videos, :viewed_videos) -> 0.0110s == 20231023123047 RenameViewVideosToViewedVideos: migrated (0.0111s) ==========
I, [2023-10-29T16:42:28.367401 #2] INFO -- : Migrating to RenameVideoUrlToVideoIdInViewedVideos (20231024150402) == 20231024150402 RenameVideoUrlToVideoIdInViewedVideos: migrating ============ -- rename_column(:viewed_videos, :video_url, :video_id) -> 0.0066s == 20231024150402 RenameVideoUrlToVideoIdInViewedVideos: migrated (0.0067s) ===
I, [2023-10-29T16:42:28.376539 #2] INFO -- : Migrating to RemoveVideoLengthFromUsers (20231024191021) == 20231024191021 RemoveVideoLengthFromUsers: migrating ======================= -- remove_column(:users, :min_video_length, :integer) -> 0.0015s -- remove_column(:users, :max_video_length, :integer) -> 0.0009s == 20231024191021 RemoveVideoLengthFromUsers: migrated (0.0025s) ==============
I, [2023-10-29T16:42:28.381449 #2] INFO -- : Migrating to AddVideoLengthToUsers (20231024193201) == 20231024193201 AddVideoLengthToUsers: migrating ============================ -- add_column(:users, :video_length, :integer, {:default=>0}) -> 0.0023s == 20231024193201 AddVideoLengthToUsers: migrated (0.0023s) ===================
I, [2023-10-29T16:42:28.386309 #2] INFO -- : Migrating to ChangeDefaultOfIsAutomaticallyPostedInUsers (20231025183317) == 20231025183317 ChangeDefaultOfIsAutomaticallyPostedInUsers: migrating ====== -- change_column_default(:users, :is_automatically_posted, true) -> 0.0035s == 20231025183317 ChangeDefaultOfIsAutomaticallyPostedInUsers: migrated (0.0036s)
I, [2023-10-29T16:42:28.392539 #2] INFO -- : Migrating to ChangeDefaultOfIsAutomaticallyPostedInUsersAgain (20231025183550) == 20231025183550 ChangeDefaultOfIsAutomaticallyPostedInUsersAgain: migrating = -- change_column_default(:users, :is_automatically_posted, false) -> 0.0033s == 20231025183550 ChangeDefaultOfIsAutomaticallyPostedInUsersAgain: migrated (0.0034s)
I, [2023-10-29T16:42:28.398635 #2] INFO -- : Migrating to AddBoardIdToViewedVideosTable (20231026105413) == 20231026105413 AddBoardIdToViewedVideosTable: migrating ==================== -- add_reference(:viewed_videos, :alarm, {:foreign_key=>true}) -> 0.0056s -- remove_index(:viewed_videos, {:column=>[:user_id, :video_id], :unique=>true}) -> 0.0044s -- add_index(:viewed_videos, [:user_id, :alarm_id, :video_id], {:unique=>true}) -> 0.0029s == 20231026105413 AddBoardIdToViewedVideosTable: migrated (0.0130s) ===========
I, [2023-10-29T16:42:28.417458 #2] INFO -- : Migrating to AddIndexToViewedVideos (20231026111318) == 20231026111318 AddIndexToViewedVideos: migrating =========================== -- add_index(:viewed_videos, [:user_id, :video_id], {:unique=>true}) -> 0.0032s == 20231026111318 AddIndexToViewedVideos: migrated (0.0033s) ==================
I, [2023-10-29T16:42:28.423943 #2] INFO -- : Migrating to CreateLikes (20231026143650) == 20231026143650 CreateLikes: migrating ====================================== -- create_table(:likes) -> 0.0156s == 20231026143650 CreateLikes: migrated (0.0157s) =============================
I, [2023-10-29T16:42:28.442634 #2] INFO -- : Migrating to AddColumnToUsers (20231028165800) == 20231028165800 AddColumnToUsers: migrating ================================= -- remove_column(:users, :provider, :string) rake aborted! StandardError: An error has occurred, this and all later migrations canceled:
PG::UndefinedColumn: ERROR: column "provider" of relation "users" does not exist /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in'
exec' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in
block (2 levels) in execute' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/share_lock.rb:187:inyield_shares' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/dependencies/interlock.rb:41:in
permit_concurrent_loads' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:47:inblock in execute' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in
handle_interrupt' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:inblock in synchronize' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in
handle_interrupt' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:insynchronize' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_adapter.rb:752:in
block in log' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/notifications/instrumenter.rb:24:ininstrument' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_adapter.rb:743:in
log' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:46:inexecute' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/schema_statements.rb:671:in
remove_column' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:965:inblock in method_missing' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:935:in
block in say_with_time' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:935:insay_with_time' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:954:in
method_missing' /app/db/migrate/20231028165800_add_column_to_users.rb:3:inup' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:908:in
public_send' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:908:inexec_migration' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:889:in
block (2 levels) in migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:888:inblock in migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in
with_connection' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:887:inmigrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1095:in
migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1409:inblock in execute_migration_in_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/transaction.rb:319:in
block in within_new_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:inhandle_interrupt' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in
block in synchronize' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:inhandle_interrupt' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in
synchronize' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/transaction.rb:317:inwithin_new_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/database_statements.rb:316:in
transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/transactions.rb:209:intransaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1460:in
ddl_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1408:inexecute_migration_in_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1382:in
each' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1382:inmigrate_without_lock' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1331:in
block in migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1481:inblock in with_advisory_lock' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in
with_connection' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1496:inwith_advisory_lock_connection' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1477:in
with_advisory_lock' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1331:inmigrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1166:in
up' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1141:inmigrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/tasks/database_tasks.rb:262:in
migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/railties/databases.rake:92:inblock (2 levels) in <main>' /app/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/exe/rake:27:in
<top (required)>' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:58:inload' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:58:in
kernel_load' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:23:inrun' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli.rb:486:in
exec' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/command.rb:27:inrun' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in
invoke_command' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor.rb:392:indispatch' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli.rb:31:in
dispatch' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/base.rb:485:instart' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli.rb:25:in
start' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/exe/bundle:48:inblock in <top (required)>' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/friendly_errors.rb:120:in
with_friendly_errors' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/exe/bundle:36:in<top (required)>' /app/bin/bundle:113:in
load' /app/bin/bundle:113:in `Caused by: ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR: column "provider" of relation "users" does not exist /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in'
exec' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in
block (2 levels) in execute' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/share_lock.rb:187:inyield_shares' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/dependencies/interlock.rb:41:in
permit_concurrent_loads' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:47:inblock in execute' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in
handle_interrupt' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:inblock in synchronize' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in
handle_interrupt' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:insynchronize' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_adapter.rb:752:in
block in log' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/notifications/instrumenter.rb:24:ininstrument' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_adapter.rb:743:in
log' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:46:inexecute' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/schema_statements.rb:671:in
remove_column' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:965:inblock in method_missing' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:935:in
block in say_with_time' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:935:insay_with_time' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:954:in
method_missing' /app/db/migrate/20231028165800_add_column_to_users.rb:3:inup' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:908:in
public_send' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:908:inexec_migration' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:889:in
block (2 levels) in migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:888:inblock in migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in
with_connection' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:887:inmigrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1095:in
migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1409:inblock in execute_migration_in_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/transaction.rb:319:in
block in within_new_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:inhandle_interrupt' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in
block in synchronize' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:inhandle_interrupt' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in
synchronize' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/transaction.rb:317:inwithin_new_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/database_statements.rb:316:in
transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/transactions.rb:209:intransaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1460:in
ddl_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1408:inexecute_migration_in_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1382:in
each' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1382:inmigrate_without_lock' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1331:in
block in migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1481:inblock in with_advisory_lock' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in
with_connection' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1496:inwith_advisory_lock_connection' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1477:in
with_advisory_lock' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1331:inmigrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1166:in
up' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1141:inmigrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/tasks/database_tasks.rb:262:in
migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/railties/databases.rake:92:inblock (2 levels) in <main>' /app/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/exe/rake:27:in
<top (required)>' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:58:inload' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:58:in
kernel_load' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:23:inrun' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli.rb:486:in
exec' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/command.rb:27:inrun' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in
invoke_command' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor.rb:392:indispatch' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli.rb:31:in
dispatch' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/base.rb:485:instart' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli.rb:25:in
start' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/exe/bundle:48:inblock in <top (required)>' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/friendly_errors.rb:120:in
with_friendly_errors' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/exe/bundle:36:in<top (required)>' /app/bin/bundle:113:in
load' /app/bin/bundle:113:in `Caused by: PG::UndefinedColumn: ERROR: column "provider" of relation "users" does not exist /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
exec' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:48:in
block (2 levels) in execute' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/share_lock.rb:187:inyield_shares' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/dependencies/interlock.rb:41:in
permit_concurrent_loads' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:47:inblock in execute' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in
handle_interrupt' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:inblock in synchronize' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in
handle_interrupt' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:insynchronize' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_adapter.rb:752:in
block in log' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/notifications/instrumenter.rb:24:ininstrument' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract_adapter.rb:743:in
log' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/postgresql/database_statements.rb:46:inexecute' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/schema_statements.rb:671:in
remove_column' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:965:inblock in method_missing' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:935:in
block in say_with_time' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:935:insay_with_time' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:954:in
method_missing' /app/db/migrate/20231028165800_add_column_to_users.rb:3:inup' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:908:in
public_send' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:908:inexec_migration' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:889:in
block (2 levels) in migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:888:inblock in migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in
with_connection' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:887:inmigrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1095:in
migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1409:inblock in execute_migration_in_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/transaction.rb:319:in
block in within_new_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:inhandle_interrupt' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:25:in
block in synchronize' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:inhandle_interrupt' /app/vendor/bundle/ruby/3.1.0/gems/activesupport-7.0.8/lib/active_support/concurrency/load_interlock_aware_monitor.rb:21:in
synchronize' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/transaction.rb:317:inwithin_new_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/database_statements.rb:316:in
transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/transactions.rb:209:intransaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1460:in
ddl_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1408:inexecute_migration_in_transaction' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1382:in
each' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1382:inmigrate_without_lock' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1331:in
block in migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1481:inblock in with_advisory_lock' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:215:in
with_connection' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1496:inwith_advisory_lock_connection' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1477:in
with_advisory_lock' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1331:inmigrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1166:in
up' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/migration.rb:1141:inmigrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/tasks/database_tasks.rb:262:in
migrate' /app/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.8/lib/active_record/railties/databases.rake:92:inblock (2 levels) in <main>' /app/vendor/bundle/ruby/3.1.0/gems/rake-13.1.0/exe/rake:27:in
<top (required)>' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:58:inload' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:58:in
kernel_load' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli/exec.rb:23:inrun' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli.rb:486:in
exec' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/command.rb:27:inrun' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in
invoke_command' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor.rb:392:indispatch' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli.rb:31:in
dispatch' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/vendor/thor/lib/thor/base.rb:485:instart' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/cli.rb:25:in
start' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/exe/bundle:48:inblock in <top (required)>' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/lib/bundler/friendly_errors.rb:120:in
with_friendly_errors' /app/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.25/exe/bundle:36:in<top (required)>' /app/bin/bundle:113:in
load' /app/bin/bundle:113:in `エラーから考えられる原因 前述の処理をしたせいで、herokuからすると、usersテーブルにまだproviderカラムとuidカラムがないのに、下記のマイグレーションファイルが両カラムをremoveしようとしているため上記のエラーが表示されているのだと思います。
試したこと すいません。手動で巻き戻すことも考えたのですが、あまりにも複雑な状況になってしまっているので、下手に何かをしないほうが良いと判断し、まだ何も行っていません。
長文失礼いたしました。ご対応よろしくお願いいたします。