Skip to content

Commit 87cc918

Browse files
author
Zachary Scott
committed
💅 for migrations guide from rails#15457 [ci skip]
1 parent 1cfa4cc commit 87cc918

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

guides/source/migrations.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -417,25 +417,26 @@ column and adds an index on it. Finally it renames the `upccode` column.
417417

418418
### Changing Columns
419419

420-
Like the `remove_column` and `add_column` Rails provides the `change_column`.
420+
Like the `remove_column` and `add_column` Rails provides the `change_column`
421+
migration method.
421422

422423
```ruby
423424
change_column :products, :part_number, :text
424425
```
425426

426-
This changes the column part_number on products table to be a text.
427+
This changes the column `part_number` on products table to be a `:text` field.
427428

428-
Besides the `change_column`, the `change_column_null` and
429-
`change_column_default` are used specifically to change the null and default
430-
values of a column.
429+
Besides `change_column`, the `change_column_null` and `change_column_default`
430+
methods are used specifically to change the null and default values of a
431+
column.
431432

432433
```ruby
433434
change_column_null :products, :name, false
434435
change_column_default :products, :approved, false
435436
```
436437

437-
This sets name on products to a NOT NULL column and the default value
438-
of approved as false.
438+
This sets `:name` field on products to a `NOT NULL` column and the default
439+
value of the `:approved` field to false.
439440

440441
### When Helpers aren't Enough
441442

0 commit comments

Comments
 (0)