projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
AccountView: Return user ap_id.
[akkoma]
/
lib
/
pleroma
/
release_tasks.ex
diff --git
a/lib/pleroma/release_tasks.ex
b/lib/pleroma/release_tasks.ex
index 7726bc635836c2d4859c492efc73b26cc767f282..02dd6c325db8fc13e1bfae53522c4694534220e6 100644
(file)
--- a/
lib/pleroma/release_tasks.ex
+++ b/
lib/pleroma/release_tasks.ex
@@
-1,23
+1,23
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-20
19
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-20
20
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ReleaseTasks do
@repo Pleroma.Repo
def run(args) do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ReleaseTasks do
@repo Pleroma.Repo
def run(args) do
- Mix.Tasks.Pleroma.Common.start_pleroma()
[task | args] = String.split(args)
case task do
[task | args] = String.split(args)
case task do
- "migrate" -> migrate()
+ "migrate" -> migrate(
args
)
"create" -> create()
"create" -> create()
- "rollback" -> rollback(
String.to_integer(Enum.at(args, 0))
)
+ "rollback" -> rollback(
args
)
task -> mix_task(task, args)
end
end
defp mix_task(task, args) do
task -> mix_task(task, args)
end
end
defp mix_task(task, args) do
+ Application.load(:pleroma)
{:ok, modules} = :application.get_key(:pleroma, :modules)
module =
{:ok, modules} = :application.get_key(:pleroma, :modules)
module =
@@
-35,15
+35,17
@@
defmodule Pleroma.ReleaseTasks do
end
end
end
end
- def migrate do
-
{:ok, _, _} = Ecto.Migrator.with_repo(@repo, &Ecto.Migrator.run(&1, :up, all: true)
)
+ def migrate
(args)
do
+
Mix.Tasks.Pleroma.Ecto.Migrate.run(args
)
end
end
- def rollback(
version
) do
-
{:ok, _, _} = Ecto.Migrator.with_repo(@repo, &Ecto.Migrator.run(&1, :down, to: version)
)
+ def rollback(
args
) do
+
Mix.Tasks.Pleroma.Ecto.Rollback.run(args
)
end
def create do
end
def create do
+ Application.load(:pleroma)
+
case @repo.__adapter__.storage_up(@repo.config) do
:ok ->
IO.puts("The database for #{inspect(@repo)} has been created")
case @repo.__adapter__.storage_up(@repo.config) do
:ok ->
IO.puts("The database for #{inspect(@repo)} has been created")