schema.rb の並び順を $ rails db:migrate:reset 直後の並び順に修正 #4162
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
目的
$ bin/setup
や$ rails db:migrate:reset
の実行後に、schema ファイルのテーブルやカラムの並び順の diff が生じないようにすること並び順の diff が生じる原因として考えたこと
campaigns
テーブルもともとは
extended_trials
というテーブル名で schema に追加されたものの、その後に テーブル名をcampaigns
に変更したため、テーブルの位置が並び順と異なるようになったと考えられる42c3fc9#diff-0be067478caaa68b2a1692038616c1f33ecd6374cd9a445bf3cbbed5ca21ee16R3
users
テーブルのafter_graduation_hope
カラムafter_graduation_hope
カラムとnotified_retirement
カラムについて、「マイグレーションファイルを作成した日時」と「それぞれの PR がマージされた順番」が前後したことにより、カラムの位置が前後した可能性があるやったこと
$ rails db:migrate:reset
の実行直後の並び順をコミットした動作確認手順
$ git checkout chore/fix-order-of-campaign-table-and-a-column-of-user-table-in-schema
$ rails db:migrate:reset