Skip to content

Commit c7d58a3

Browse files
authored
Add missing variants in migration command spec (#486)
1 parent 8d43286 commit c7d58a3

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

lib/ecto/adapter/migration.ex

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,31 @@ defmodule Ecto.Adapter.Migration do
33
Specifies the adapter migrations API.
44
"""
55

6+
alias Ecto.Migration.Constraint
67
alias Ecto.Migration.Table
78
alias Ecto.Migration.Index
89
alias Ecto.Migration.Reference
910

1011
@type adapter_meta :: Ecto.Adapter.adapter_meta()
1112

13+
@type drop_mode :: :restrict | :cascade
14+
1215
@typedoc "All migration commands"
1316
@type command ::
1417
raw ::
1518
String.t()
1619
| {:create, Table.t(), [table_subcommand]}
1720
| {:create_if_not_exists, Table.t(), [table_subcommand]}
1821
| {:alter, Table.t(), [table_subcommand]}
19-
| {:drop, Table.t(), :restrict | :cascade}
20-
| {:drop_if_exists, Table.t(), :restrict | :cascade}
22+
| {:drop, Table.t(), drop_mode()}
23+
| {:drop_if_exists, Table.t(), drop_mode()}
2124
| {:create, Index.t()}
2225
| {:create_if_not_exists, Index.t()}
23-
| {:drop, Index.t(), :restrict | :cascade}
24-
| {:drop_if_exists, Index.t(), :restrict | :cascade}
26+
| {:drop, Index.t(), drop_mode()}
27+
| {:drop_if_exists, Index.t(), drop_mode()}
28+
| {:create, Constraint.t()}
29+
| {:drop, Constraint.t(), drop_mode()}
30+
| {:drop_if_exists, Constraint.t(), drop_mode()}
2531

2632
@typedoc "All commands allowed within the block passed to `table/2`"
2733
@type table_subcommand ::

0 commit comments

Comments
 (0)