Closed dberg918 closed 3 months ago
If your issue is related only to plugins not yet supporting netbox 4.x, there's no need to delete the data structures they have in the database, it's sufficient to comment out the plugin-related content in configuration.py. These instructions may however be useful if you want to uninstall the plugin and purge its contents from the database.
I had to re-read your comment a few times to understand your point. Yes, if you just want to remove a plugin temporarily while you wait for it to support the new version, commenting it out in configuration.py
is enough. However, the documentation does not delineate between removing a plugin temporarily and removing a plugin permanently.
Either way, I think if it provides instructions on how to drop a plugin's tables from the database, it should also provide instructions to remove its entries from the django_migrations
table since they go hand-in-hand. Otherwise, the plugin will be broken if the user ever decides to re-install it.
I can submit a pull request, but I need to have this issue assigned to me first and it looks like I can't do it myself. @arthanson would you be able to assist?
@peteeckel actually raised the same issue with #16748 and got a fixed merged last month, so this can be closed.
Change Type
Addition
Area
Plugins
Proposed Changes
Recently I upgraded my Netbox instance to 4.x and had to remove the netbox-topology-views plugin since the beta was not ready yet. I followed the instructions in the documentation to remove the plugin from the configuration and to drop the tables it created in the netbox database and everything seemed fine.
After the beta version of the plugin was released last week, I decided to try it out. The installation worked fine, but when running the
manage.py migrate netbox_topology_views
command, it did not repopulate the tables in the netbox database. As a result, the plugin threw errors complaining that the requisite tables did not exist in the database, and running upgrades similarly failed with an identical error message. Eventually, I figured out this was because there were still entries fornetbox_topology_views
in mydjango_migrations
table. After I removed these, the migrations worked correctly and populated the database with the necessary tables.I'd like to propose adding a small section to the end of the "Removing a Plugin" section that includes deleting entries in the
django_migrations
table. I've written a sample below:Also check for entries in the
django_migrations
table using the samepluginname
:Drop the entries in the
django_migrations
table if they exist: