0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【Rails】複数ファイルのmigrateに失敗した時、どこまで処理できているか確認する方法

Posted at

migrateがうまくいかない

複数のmigrationファイルを同時に処理しようとして、エラーが出てしまいました。

そんなときはrails db:migrate:status

ターミナルでrails db:migrate:statusを実行することで、
migrationファイルごとに、処理されたか否か、確認することができます。

$ rails db:migrate:status

database: jisibari_css_api_dev

 Status   Migration ID    Migration Name
--------------------------------------------------

   up     20181024132152  Remove 〜
   up     20181024132651  Add foreign key to 〜
   up     20181024134400  Create 〜
   up     20181030064504  Create 〜〜
  down    20181030065235  Create 〜〜〜

$

up : 処理されたmigrationファイル
down : 処理されなかったmigrationファイル

migrate実行時のエラーの原因究明に役立てば幸いです。

今日はこのあたりで失礼します。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?