diff options
author | Zachary Scott <e@zzak.io> | 2014-06-01 14:02:04 -0700 |
---|---|---|
committer | Zachary Scott <e@zzak.io> | 2014-06-01 14:02:04 -0700 |
commit | 87cc918daab39174c82b0aeb617fb8e4b4f107fb (patch) | |
tree | 72d5ae4e7ddf77beae0dbd6124a4b81a64e40945 /guides | |
parent | 1cfa4cc23d95887916ca145a72826f2561e033ac (diff) | |
download | rails-87cc918daab39174c82b0aeb617fb8e4b4f107fb.tar.gz rails-87cc918daab39174c82b0aeb617fb8e4b4f107fb.tar.bz2 rails-87cc918daab39174c82b0aeb617fb8e4b4f107fb.zip |
:nail_care: for migrations guide from #15457 [ci skip]
Diffstat (limited to 'guides')
-rw-r--r-- | guides/source/migrations.md | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/guides/source/migrations.md b/guides/source/migrations.md index 221251adf4..31e314c69b 100644 --- a/guides/source/migrations.md +++ b/guides/source/migrations.md @@ -417,25 +417,26 @@ column and adds an index on it. Finally it renames the `upccode` column. ### Changing Columns -Like the `remove_column` and `add_column` Rails provides the `change_column`. +Like the `remove_column` and `add_column` Rails provides the `change_column` +migration method. ```ruby change_column :products, :part_number, :text ``` -This changes the column part_number on products table to be a text. +This changes the column `part_number` on products table to be a `:text` field. -Besides the `change_column`, the `change_column_null` and -`change_column_default` are used specifically to change the null and default -values of a column. +Besides `change_column`, the `change_column_null` and `change_column_default` +methods are used specifically to change the null and default values of a +column. ```ruby change_column_null :products, :name, false change_column_default :products, :approved, false ``` -This sets name on products to a NOT NULL column and the default value -of approved as false. +This sets `:name` field on products to a `NOT NULL` column and the default +value of the `:approved` field to false. ### When Helpers aren't Enough |