projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'issue/733' into 'develop'
[akkoma]
/
lib
/
mix
/
tasks
/
pleroma
/
ecto
/
ecto.ex
diff --git
a/lib/mix/tasks/pleroma/ecto/ecto.ex
b/lib/mix/tasks/pleroma/ecto/ecto.ex
index af09cb289f9f7915b2e8dae8779c46b0074b7cf1..36808b93f0e9286d51e4f63d2e300c4a92770aa3 100644
(file)
--- a/
lib/mix/tasks/pleroma/ecto/ecto.ex
+++ b/
lib/mix/tasks/pleroma/ecto/ecto.ex
@@
-1,6
+1,7
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-201
8
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-201
9
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-onl
# SPDX-License-Identifier: AGPL-3.0-onl
+
defmodule Mix.Tasks.Pleroma.Ecto do
@doc """
Ensures the given repository's migrations path exists on the file system.
defmodule Mix.Tasks.Pleroma.Ecto do
@doc """
Ensures the given repository's migrations path exists on the file system.
@@
-9,6
+10,15
@@
defmodule Mix.Tasks.Pleroma.Ecto do
def ensure_migrations_path(repo, opts) do
path = opts[:migrations_path] || Path.join(source_repo_priv(repo), "migrations")
def ensure_migrations_path(repo, opts) do
path = opts[:migrations_path] || Path.join(source_repo_priv(repo), "migrations")
+ path =
+ case Path.type(path) do
+ :relative ->
+ Path.join(Application.app_dir(:pleroma), path)
+
+ :absolute ->
+ path
+ end
+
if not File.dir?(path) do
raise_missing_migrations(Path.relative_to_cwd(path), repo)
end
if not File.dir?(path) do
raise_missing_migrations(Path.relative_to_cwd(path), repo)
end
@@
-22,7
+32,7
@@
defmodule Mix.Tasks.Pleroma.Ecto do
def source_repo_priv(repo) do
config = repo.config()
priv = config[:priv] || "priv/#{repo |> Module.split() |> List.last() |> Macro.underscore()}"
def source_repo_priv(repo) do
config = repo.config()
priv = config[:priv] || "priv/#{repo |> Module.split() |> List.last() |> Macro.underscore()}"
- Path.join(
File.cwd!(
), priv)
+ Path.join(
Application.app_dir(:pleroma
), priv)
end
defp raise_missing_migrations(path, repo) do
end
defp raise_missing_migrations(path, repo) do