2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-13 18:45:40 +00:00

Maintenance Mode Improvements (#6451)

* Custom migration step in tasks.py

- Add custom management command
- Wraps migration step in maintenance mode

* Rename custom management command to "runmigrations"

- Add command to isRunningMigrations

* Add new data checks

* Update database readiness checks

- Set maintenance mode while performing certain management commands

* Remove unused import

* Re-add syncdb command

* Log warning msg

* Catch another potential error vector
This commit is contained in:
Oliver
2024-02-08 12:47:49 +11:00
committed by GitHub
parent 8b62f7b2c0
commit 633fbd37bd
9 changed files with 153 additions and 72 deletions

View File

@ -369,10 +369,9 @@ def migrate(c):
print('Running InvenTree database migrations...')
print('========================================')
manage(c, 'makemigrations')
manage(c, 'migrate --noinput')
# Run custom management command which wraps migrations in "maintenance mode"
manage(c, 'runmigrations', pty=True)
manage(c, 'migrate --run-syncdb')
manage(c, 'check')
print('========================================')
print('InvenTree database migrations completed!')