run migrations automatically on backend startup (AUTO_MIGRATIONS)

Add a migrate.sh config (ported from lasuite-docs) that the backend
entrypoint runs when AUTO_MIGRATIONS=true (default). It loads secrets,
waits for the DB, and idempotently applies pending migrations via
'migrate --check' then 'migrate --noinput'. The manual 'abra app cmd
backend migrate' now delegates to the same script.
This commit is contained in:
notplants
2026-06-23 19:13:39 +00:00
committed by notplants
parent d3c3682936
commit 0b64135f98
5 changed files with 45 additions and 4 deletions
+2 -2
View File
@@ -4,6 +4,7 @@ export ABRA_ENTRYPOINT_VERSION=v11
export NGINX_CONF_VERSION=v6
export ONLYOFFICE_CONF_VERSION=v2
export PG_BACKUP_VERSION=v4
export MIGRATE_VERSION=v1
environment() {
# this exports all the secrets as environment variables
@@ -11,8 +12,7 @@ environment() {
}
migrate() {
environment
python manage.py migrate --noinput
/migrate.sh
}
trigger_wopi() {