Skip to content

Commit 2497eba

Browse files
authored
Merge pull request rails#53583 from arzezak/update-docs
Add database reset suggestion [ci-skip]
2 parents c918c90 + e046832 commit 2497eba

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

guides/source/active_record_migrations.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,6 +1303,15 @@ contents of the current `db/schema.rb` or `db/structure.sql` file. If a
13031303
migration can't be rolled back, `bin/rails db:reset` may not help you. To find
13041304
out more about dumping the schema see [Schema Dumping and You][] section.
13051305

1306+
If you need an alternative to `db:reset` that explicitly runs all migrations,
1307+
consider using the `bin/rails db:migrate:reset` command. You can follow that
1308+
command with `bin/rails db:seed` if needed.
1309+
1310+
NOTE: `bin/rails db:reset` rebuilds the database using the current schema. On
1311+
the other hand, `bin/rails db:migrate:reset` replays all migrations from the
1312+
beginning, which can lead to schema drift if, for example, migrations have been
1313+
altered, reordered, or removed.
1314+
13061315
[Schema Dumping and You]: #schema-dumping-and-you
13071316

13081317
### Running Specific Migrations

0 commit comments

Comments
 (0)