Add bin task to vacuum the repo

This commit is contained in:
Claudio Ortolina
2025-09-16 13:42:37 +03:00
parent a0647ab91a
commit 2cb9c9288c
3 changed files with 12 additions and 0 deletions
+6
View File
@@ -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))
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
set -eu
cd -P -- "$(dirname -- "$0")"
exec ./music_library eval MusicLibrary.Release.vacuum
+1
View File
@@ -0,0 +1 @@
call "%~dp0\music_library" eval MusicLibrary.Release.vacuum