Skip to content

Commit

Permalink
align sqlite migration code with comment (#6101)
Browse files Browse the repository at this point in the history
* align code with comment

* fix tests
  • Loading branch information
rmand97 authored Feb 20, 2025
1 parent 01df1dc commit 2001cde
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion installer/templates/phx_single/lib/app_name/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ defmodule <%= @app_module %>.Application do

defp skip_migrations?() do
# By default, sqlite migrations are run when using a release
System.get_env("RELEASE_NAME") != nil
System.get_env("RELEASE_NAME") == nil
end<% end %>
end
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ defmodule <%= @app_module %>.Application do

defp skip_migrations?() do
# By default, sqlite migrations are run when using a release
System.get_env("RELEASE_NAME") != nil
System.get_env("RELEASE_NAME") == nil
end<% end %>
end
2 changes: 1 addition & 1 deletion installer/test/phx_new_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ defmodule Mix.Tasks.Phx.NewTest do
assert file =~ "skip: skip_migrations?()"

assert file =~ "defp skip_migrations?() do"
assert file =~ ~s/System.get_env("RELEASE_NAME") != nil/
assert file =~ ~s/System.get_env("RELEASE_NAME") == nil/
end)

assert_file("custom_path/test/support/conn_case.ex", "DataCase.setup_sandbox(tags)")
Expand Down
2 changes: 1 addition & 1 deletion installer/test/phx_new_umbrella_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ defmodule Mix.Tasks.Phx.New.UmbrellaTest do
assert file =~ "skip: skip_migrations?()"

assert file =~ "defp skip_migrations?() do"
assert file =~ ~s/System.get_env("RELEASE_NAME") != nil/
assert file =~ ~s/System.get_env("RELEASE_NAME") == nil/
end)

assert_file(root_path(app, "config/dev.exs"), [~r/database: .*_dev.db/])
Expand Down

0 comments on commit 2001cde

Please sign in to comment.