Add bin task to vacuum the repo
This commit is contained in:
@@ -13,6 +13,12 @@ defmodule MusicLibrary.Release do
|
||||
end
|
||||
end
|
||||
|
||||
def vacuum do
|
||||
load_app()
|
||||
|
||||
Ecto.Migrator.with_repo(MusicLibrary.Repo, fn repo -> repo.vacuum() end)
|
||||
end
|
||||
|
||||
def rollback(repo, version) do
|
||||
load_app()
|
||||
{:ok, _, _} = Ecto.Migrator.with_repo(repo, &Ecto.Migrator.run(&1, :down, to: version))
|
||||
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
cd -P -- "$(dirname -- "$0")"
|
||||
exec ./music_library eval MusicLibrary.Release.vacuum
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
call "%~dp0\music_library" eval MusicLibrary.Release.vacuum
|
||||
Reference in New Issue
Block a user