*/init.d/pleroma: run migrations before starting

This commit is contained in:
Haelwenn (lanodan) Monnier 2024-12-19 21:49:32 +01:00
parent a1247220f3
commit 9bbeeeb428
No known key found for this signature in database
3 changed files with 13 additions and 0 deletions

View file

@ -0,0 +1 @@
- OpenRC: Automatically run migrations before starting pleroma

View file

@ -37,6 +37,12 @@ depend() {
need nginx postgresql
}
start_pre() {
ebegin "running migrations if any"
su -s /bin/sh -c '/usr/bin/mix ecto.migrate' -l "${command_user}"
eend "$?"
}
healthcheck() {
# put pleroma_health=YES in /etc/conf.d/pleroma if you want healthchecking
# and make sure you have curl installed

View file

@ -24,3 +24,9 @@ depend() {
want nginx
need postgresql
}
start_pre() {
ebegin "running migrations if any"
su -s /bin/sh -c '/opt/pleroma/bin/pleroma_ctl migrate' -l "${command_user}"
eend "$?"
}