Просмотр исходного кода

Closes #3347: Extend upgrade script to automatically remove stale content types

Jeremy Stretch 6 лет назад
Родитель
Сommit
eeb3434349
2 измененных файлов с 6 добавлено и 0 удалено
  1. 1 0
      CHANGELOG.md
  2. 5 0
      upgrade.sh

+ 1 - 0
CHANGELOG.md

@@ -2,6 +2,7 @@ v2.6.5 (FUTURE)
 
 ## Enhancements
 
+* [#3347](https://github.com/netbox-community/netbox/issues/3347) -  Extend upgrade script to automatically remove stale content types
 * [#3352](https://github.com/netbox-community/netbox/issues/3352) -  Enable filtering changelog API by `changed_object_id`
 * [#3524](https://github.com/netbox-community/netbox/issues/3524) -  Enable bulk editing of power outlet/power port associations
 * [#3529](https://github.com/netbox-community/netbox/issues/3529) -  Enable filtering circuits list by region

+ 5 - 0
upgrade.sh

@@ -25,6 +25,11 @@ COMMAND="${PYTHON} netbox/manage.py migrate"
 echo "Applying database migrations ($COMMAND)..."
 eval $COMMAND
 
+# Delete any stale content types
+COMMAND="${PYTHON} netbox/manage.py remove_stale_contenttypes --no-input"
+echo "Removing stale content types ($COMMAND)..."
+eval $COMMAND
+
 # Collect static files
 COMMAND="${PYTHON} netbox/manage.py collectstatic --no-input"
 echo "Collecting static files ($COMMAND)..."