Skip to content

Commit e57c91a

Browse files
authored
Clarify that index names can be a string or an atom (#639)
1 parent 6e7a49e commit e57c91a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/ecto/migration.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ defmodule Ecto.Migration do
396396
@type t :: %__MODULE__{
397397
table: String.t(),
398398
prefix: String.t() | nil,
399-
name: atom,
399+
name: String.t() | atom,
400400
columns: [atom | String.t()],
401401
unique: boolean,
402402
concurrently: boolean,
@@ -779,7 +779,8 @@ defmodule Ecto.Migration do
779779
780780
## Options
781781
782-
* `:name` - the name of the index. Defaults to "#{table}_#{column}_index".
782+
* `:name` - the name of the index. Can be provided as a string or an atom.
783+
Defaults to "#{table}_#{column}_index".
783784
* `:prefix` - specify an optional prefix for the index.
784785
* `:unique` - indicates whether the index should be unique. Defaults to `false`.
785786
* `:comment` - adds a comment to the index.

0 commit comments

Comments
 (0)