Cannot run migrations because another migration process is currently running.
**********@mbp ****** % rails db:migrate
rails aborted!
ActiveRecord::ConcurrentMigrationError:
Cannot run migrations because another migration process is currently running.
訳
別のマイグレーションプロセスが実行中のため、マイグレーションを実行できない
出典 deepL
検索
気づき
MySQLの処理中のマイグレーションを削除すればいいらしい。
KILLとは?
13.7.8.4 KILL Statement
KILL [CONNECTION | QUERY] processlist_id
Each connection to mysqld runs in a separate thread. You can kill a thread with the KILL processlist_id statement.
Thread processlist identifiers can be determined from the ID column of the INFORMATION_SCHEMA PROCESSLIST table, the Id column of SHOW PROCESSLIST output, and the PROCESSLIST_ID column of the Performance Schema threads table. The value for the current thread is returned by the CONNECTION_ID() function.
出典
訳
mysqldへの各接続は、別々のスレッドで実行されます。KILL processlist_idステートメントでスレッドを強制終了することができます。
スレッドプロセスリストの識別子は、INFORMATION_SCHEMA PROCESSLISTテーブルのID列、SHOW PROCESSLIST出力のId列、Performance Schema threadsテーブルのPROCESSLIST_ID列から求めることができます。現在のスレッドの値は、CONNECTION_ID()関数によって返されます。
出典 deepL
CONNECTION_ID()とは?
CONNECTION_ID()
Returns the connection ID (thread ID) for the connection. Every connection has an ID that is unique among the set of currently connected clients.
出典
CONNECTION_ID関数を使用することで、現在接続中の自分の接続IDを調べることができます。
出典
感想
migration process is currently running.
で
プロセスが実行中であると判断するのか。
それからSHOW PROCESSLIST;
で現在の実行中のプロセスをKILL
でIDを指定して、強制終了させるのか。
もっと理解しないといけないようだ。