Merge branch 'change_migration_style_guide' into 'master'

[Migration guide] Add a note about prefering change_column_null over change_column

See merge request !11473
This commit is contained in:
Yorick Peterse 2017-05-18 11:19:39 +00:00
commit 8f2bdeb723
1 changed files with 2 additions and 0 deletions

View File

@ -139,6 +139,8 @@ Adding or removing a NOT NULL clause (or another constraint) can typically be
done without requiring downtime. However, this does require that any application
changes are deployed _first_. Thus, changing the constraints of a column should
happen in a post-deployment migration.
NOTE: Avoid using `change_column` as it produces inefficient query because it re-defines
the whole column type. For example, to add a NOT NULL constraint, prefer `change_column_null `
## Changing Column Types