Help us understand the problem. What is going on with this article?

Rails: db:reset よりも db:migrate:reset を使うべき理由 (とその違い)

More than 1 year has passed since last update.

なぜなら。

db:reset < db:migrate:reset

という関係で、後者の方が強力だからだ。
db:migrate:reset はすべてをやり直してくれる。

自分はこの関係を理解しておらず 「db:resetの方が強力だ」と思い込んでいたため、はまった。

両者の違い

  • db:reset はマイグレーションファイルを編集しても、その内容は反映されない。スキーマファイル ( db/schema.rb ) だけを利用する。
  • db:migrate:reset はマイグレーションファイルを直接利用する。つまり、変更が反映される。

備考

Links

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした