File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -417,25 +417,26 @@ column and adds an index on it. Finally it renames the `upccode` column.
417
417
418
418
### Changing Columns
419
419
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.
421
422
422
423
``` ruby
423
424
change_column :products , :part_number , :text
424
425
```
425
426
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 .
427
428
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.
431
432
432
433
``` ruby
433
434
change_column_null :products , :name , false
434
435
change_column_default :products , :approved , false
435
436
```
436
437
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.
439
440
440
441
### When Helpers aren't Enough
441
442
You can’t perform that action at this time.
0 commit comments