Skip to content

Commit f8e3295

Browse files
authored
Add note to modify/3 docs about avoiding type mods (#353)
1 parent ab8b5e3 commit f8e3295

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/ecto/migration.ex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,12 @@ defmodule Ecto.Migration do
10281028
10291029
See `add/3` for more information on supported types.
10301030
1031+
If you want to modify a column without changing its type,
1032+
such as adding or dropping a null constraints, consider using
1033+
the `execute/2` command with the relevant SQL command instead
1034+
of `modify/3`, if supported by your database. This may avoid
1035+
redundant type updates and be more efficient.
1036+
10311037
## Examples
10321038
10331039
alter table("posts") do

0 commit comments

Comments
 (0)