Skip to content

Commit 941d6be

Browse files
authored
Merge pull request rails#53599 from jaredholdcroft/patch-1
[ci skip] Update getting_started.md
2 parents cd3524c + 932bd4a commit 941d6be

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

guides/source/getting_started.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1728,8 +1728,13 @@ And next, let's update the database with the generated migrations:
17281728
$ bin/rails db:migrate
17291729
```
17301730

1731-
To choose the status for the existing articles and comments you can add a default value to the generated migration files by adding the `default: "public"` option and launch the migrations again. You can also call in a rails console `Article.update_all(status: "public")` and `Comment.update_all(status: "public")`.
1731+
To choose the status for the existing articles and comments you can add a default value to the generated migration files by adding the `default: "public"` option. Once you have made a change to the migration file you can re-run that last step again:
17321732

1733+
```bash
1734+
$ bin/rails db:migrate:redo
1735+
```
1736+
1737+
You can also call in a rails console `Article.update_all(status: "public")` and `Comment.update_all(status: "public")`.
17331738

17341739
TIP: To learn more about migrations, see [Active Record Migrations](
17351740
active_record_migrations.html).

0 commit comments

Comments
 (0)