@@ -760,7 +760,7 @@ defmodule Ecto.Migration do
760760 end
761761
762762 def table ( name , opts ) when is_binary ( name ) and is_list ( opts ) do
763- struct ( % Table { name: name } , opts )
763+ struct! ( % Table { name: name } , opts )
764764 end
765765
766766 @ doc ~S"""
@@ -926,7 +926,7 @@ defmodule Ecto.Migration do
926926
927927 def index ( table , columns , opts ) when is_binary ( table ) and is_list ( columns ) and is_list ( opts ) do
928928 validate_index_opts! ( opts )
929- index = struct ( % Index { table: table , columns: columns } , opts )
929+ index = struct! ( % Index { table: table , columns: columns } , opts )
930930 % { index | name: index . name || default_index_name ( index ) }
931931 end
932932
@@ -1417,7 +1417,7 @@ defmodule Ecto.Migration do
14171417
14181418 def references ( table , opts ) when is_binary ( table ) and is_list ( opts ) do
14191419 opts = Keyword . merge ( foreign_key_repo_opts ( ) , opts )
1420- reference = struct ( % Reference { table: table } , opts )
1420+ reference = struct! ( % Reference { table: table } , opts )
14211421 check_on_delete! ( reference . on_delete )
14221422 check_on_update! ( reference . on_update )
14231423
@@ -1486,7 +1486,7 @@ defmodule Ecto.Migration do
14861486 end
14871487
14881488 def constraint ( table , name , opts ) when is_binary ( table ) and is_list ( opts ) do
1489- struct ( % Constraint { table: table , name: name } , opts )
1489+ struct! ( % Constraint { table: table , name: name } , opts )
14901490 end
14911491
14921492 @ doc "Executes queue migration commands."
0 commit comments