mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-27 21:47:59 +01:00
a244b8d322
make user link Update structure for artist links bap
43 lines
842 B
Elixir
43 lines
842 B
Elixir
defmodule Philomena.Release do
|
|
@app :philomena
|
|
|
|
def migrate do
|
|
load_app()
|
|
|
|
for repo <- repos() do
|
|
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :up, all: true))
|
|
end
|
|
end
|
|
|
|
def rollback(repo, version) do
|
|
load_app()
|
|
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version))
|
|
end
|
|
|
|
def update_channels do
|
|
start_app()
|
|
Philomena.Channels.update_tracked_channels!()
|
|
end
|
|
|
|
def verify_artist_links do
|
|
start_app()
|
|
Philomena.ArtistLinks.automatic_verify!()
|
|
end
|
|
|
|
def update_stats do
|
|
start_app()
|
|
PhilomenaWeb.StatsUpdater.update_stats!()
|
|
end
|
|
|
|
defp repos do
|
|
Application.fetch_env!(@app, :ecto_repos)
|
|
end
|
|
|
|
defp load_app do
|
|
Application.load(@app)
|
|
end
|
|
|
|
defp start_app do
|
|
Application.ensure_all_started(@app)
|
|
end
|
|
end
|