We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
generate_migrations
1 parent a5f457e commit 9f24fa0Copy full SHA for 9f24fa0
1 file changed
lib/mix/tasks/ash_sqlite.generate_migrations.ex
@@ -92,6 +92,18 @@ defmodule Mix.Tasks.AshSqlite.GenerateMigrations do
92
93
@shortdoc "Generates migrations, and stores a snapshot of your resources"
94
def run(args) do
95
+ {name, args} =
96
+ case args do
97
+ ["-" <> _ | _] ->
98
+ {nil, args}
99
+
100
+ [first | rest] ->
101
+ {first, rest}
102
103
+ [] ->
104
+ {nil, []}
105
+ end
106
107
{opts, _, _} =
108
OptionParser.parse(args,
109
strict: [
@@ -122,6 +134,7 @@ defmodule Mix.Tasks.AshSqlite.GenerateMigrations do
122
134
opts
123
135
|> Keyword.put(:format, !opts[:no_format])
124
136
|> Keyword.delete(:no_format)
137
+ |> Keyword.put_new(:name, name)
125
138
126
139
AshSqlite.MigrationGenerator.generate(domains, opts)
127
140
end
0 commit comments