[
{ type: install
  message: <<EOD
Please note that NetBox requires a PostgreSQL database server, which uses its
built-in network address datatypes. Thus NetBox won't work with other RDBMS's,
e.g. MySQL, MariaDB, etc.

For installation instructions please refer to the related wiki page:

- https://wiki.freebsd.org/Ports/net-mgmt/netbox
EOD
}
{ type: upgrade
  message: <<EOD
As always it is strongly encouraged to make a backup of the database before the
database migrations will be executed.

The following steps are required to finish the upgrade: 

1. Run database migrations, trace any missing cable paths, build the embedded
   documentation, collect static files, remove stale content files, delete any
   expired user sessions and clear the cache.

# cd %%DATADIR%%
# python%%PYTHON_VER%% manage.py migrate
# python%%PYTHON_VER%% manage.py trace_paths --no-input
# zensical build
# python%%PYTHON_VER%% manage.py collectstatic --no-input
# python%%PYTHON_VER%% manage.py remove_stale_contenttypes --no-input
# python%%PYTHON_VER%% manage.py reindex --lazy
# python%%PYTHON_VER%% manage.py clearsessions

2. Restart WSGI/httpd environment (supervisord/apache/nginx/etc.)
EOD
}
{ type: upgrade
  maximum_version: 3.6.1
  message: <<EOD
1. The NetBox 3.6 release contains some breaking changes, so the following
   items should be checked before upgrading:

   * PostgreSQL 11 is no longer supported (dropped in Django 4.2). NetBox v3.6
     requires PostgreSQL 12 or later.

   * The "device_role" field on the Device model has been renamed to "role".
     The "device_role" field has been temporarily retained on the REST API
     serializer for devices for backward compatibility, but is read-only.

   * The "choices" array field has been removed from the CustomField model.
     Any defined choices are automatically migrated to CustomFieldChoiceSets,
     accessible via the new "choice_set" field on the CustomField model.

   * The "napalm_driver" and "napalm_args" fields (which were deprecated in v3.5)
     have been removed from the Platform model.

   * The "device" and "device_id" filter for interfaces will no longer include
     interfaces from virtual chassis peers. Two new filters,
     "virtual_chassis_member" and "virtual_chassis_member_id", have been
     introduced to match all interfaces belonging to the specified device's
     virtual chassis (if any).

   * Reports and scripts are now returned within a "results" list when fetched via
     the REST API, consistent with other models.

   * Superusers can no longer retrieve API token keys via the web UI if
     ALLOW_TOKEN_RETRIEVAL is disabled. (The admin view has been removed
     per #13044.)

2. The following dependencies are now optional and have therefore been moved to
   corresponding options. An exception is the LDAP option, which has been added
   for the sake of completeness, because this backend has been around for a
   good while:

   * devel/py-dulwich			-> non-default GIT option
   * www/py-dj42-django-auth-ldap	-> non-default LDAP option
   * www/py-boto3			-> non-default S3 option
EOD
}
{ type: upgrade
  maximum_version: 3.7.0
  message: <<EOD
1. The NetBox 3.7 release contains some breaking changes, so the following
   items should be checked before upgrading:

   * The following fields have been removed from the Webhook model:

     "content_types", "type_create", "type_update", "type_delete",
     "type_job_start", "type_job_end", "enabled", and "conditions".

     Webhooks are now tied to events via event rules. New event rules will be
     created for any existing webhooks automatically upon upgrade.

   * The "ui_visibility" field on the custom field model has been replaced with
     two new fields: "ui_visible" and "ui_editable".

     These new fields will have their values mapped from the original field
     automatically upon upgrade.

   * The "FeatureQuery" class used internally for querying content types by
     model feature has been removed. It has been replaced by the new
     "with_feature()" manager method on NetBox's proxy model for ContentType
     ("core.models.ContentType").

   * The internal ConfigRevision model has moved from "extras" to "core".
     Configuration history will be retained throughout the upgrade process.

   * The L2VPN and L2VPNTermination models have moved from the "ipam" app to
     the new "vpn" app. All object data will be retained, however please note
     that the relevant API endpoints have likewise moved to "/api/vpn/".

   * The "CustomFieldsMixin", "SavedFiltersMixin", and "TagsMixin" classes
     have moved from the "extras.forms.mixins" module to
     "netbox.forms.mixins".

   * The "netbox.models.features.WebhooksMixin" class has been renamed
     to "EventRulesMixin".

2. The following dependency is now optional and has therefore been converted
   to a corresponding SENTRY option:

   * devel/py-sentry-sdk	-> non-default SENTRY option

3. Please note that the command "python%%PYTHON_VER%% manage.py clearcache" has
   been removed.

   The general update instructions in this pkg-message and the netbox sample rc
   script (available via the EXAMPLES option) have also been updated
   accordingly.
EOD
}
{ type: upgrade
  maximum_version: 4.0.5
  message: <<EOD
The NetBox 4.0 release contains major changes, so at least items 1.) and 2.)
must be checked before proceeding with the upgrade.

1. NetBox v4.0 requires Python 3.10 or later.

2. Following items should be checked as well:

    * The format for GraphQL query filters has changed.  Please see the
      GraphQL documentation for details and examples.

    * The deprecated "device_role" & "device_role_id" filters for devices have
      been removed.  (Use "role" and "role_id" instead.)

    * The obsolete "device_role" field has been removed from the REST API
      serializer for devices.  (Use "role" instead.)

    * The legacy reports functionality has been dropped. Reports will be
      automatically converted to custom scripts on upgrade.

    * The "parent" and "parent_id" filters for locations now return only
      immediate children of the specified location.  (Use "ancestor" and
      "ancestor_id" to return all descendants.)

    * The "object_type" field on the "CustomField" model has been renamed to
      "related_object_type".

    * The "utilities.utils module" has been removed and its resources
      reorganized into separate modules organized by function.

    * The obsolete "NullableCharField" class has been removed.  (Use Django's
      stock "CharField" class with "null=True" instead.)

    * The "annotated_date" template filter and "annotated_now" template tag
      have been removed.
EOD
}
{ type: upgrade
  maximum_version: 4.1.6
  message: <<EOD
1. The NetBox 4.1 release contains some breaking changes, so the following
   items should be checked before upgrading:

   * Several filters deprecated in v4.0 have been removed.

   * The unit size for "VirtualMachine.disk" and "VirtualDisk.size" has been
     changed from 1 gigabyte to 1 megabyte. Existing values will be adjusted
     automatically during the upgrade process.

   * The "min_vid" and "max_vid" fields on the VLAN group model have been
     replaced with "vid_ranges", an array of starting and ending VLAN ID pairs.

   * The five individual event type fields on the "EventRule" model have been
     replaced by a single "event_types" array field, which lists applicable
     event types by name.

   * All UI views & API endpoints associated with change records have been
     moved from "/extras" to "/core".

   * The "validate()" method on "CustomValidator" subclasses now must accept
     the request argument.
EOD
}
{ type: upgrade
  maximum_version: 4.2.3
  message: <<EOD
1. The NetBox 4.2 release contains some breaking changes, so the following
   items should be checked before upgrading:

   * Support for the Django admin UI has been completely removed.  (The Django
     admin UI was disabled by default in NetBox v4.0.)

   * This release drops support for PostgreSQL 12.  PostgreSQL 13 or later is
     required to run this release.

   * NetBox has adopted collation-based natural ordering for many models.  This
     may alter the order in which some objects are listed by default.

   * Automatic redirects from pre-v4.1 UI views for virtual disks have been
     removed.

   * The site and provider_network foreign key fields on
     "circuits.CircuitTermination" have been replaced by the "termination"
     generic foreign key.

   * The "site" foreign key field on "ipam.Prefix" has been replaced by the
     "scope" generic foreign key.

   * The "site" foreign key field on "virtualization.Cluster" has been replaced
     by the "scope" generic foreign key.

   * The "circuit" foreign key field on "circuits.CircuitGroupAssignment" has
     been replaced by the "member" generic foreign key.

   * Obsolete nested REST API serializers have been removed.  These were
     deprecated in NetBox v4.1 under #17143.
EOD
}
{ type: upgrade
  maximum_version: 4.3.2
  message: <<EOD
1. The NetBox 4.3 release contains some breaking changes, so the following
   items should be checked before upgrading:

   * This release drops support for PostgreSQL 13.  PostgreSQL 14 or later is
     required to run this release.

2. Following items should be checked as well:

   * The GraphQL API now uses an advanced syntax for filtering, to enable e.g.
     logical AND/OR filtering and custom field lookups.

   * The ALLOW_TOKEN_RETRIEVAL configuration parameter now defaults to False.

   * The "device" and "virtual_machine" foreign keys on the "Service" model
     have been replaced with a generic parent relationship to support the
     assignment of services to FHRP groups as well.

   * The group foreign key on the "Contact" model has been replaced with a
     many-to-many groups field.

   * "django-storages" is now a required dependency.  (It will be installed
     automatically on upgrade via www/py-dj52-django-storages.)

   * "PluginTemplateExtension" no longer supports registration via the singular
     model attribute (use models instead).

   * The legacy staged changes functionality has been removed.
EOD
}
{ type: upgrade
  maximum_version: 4.5.4
  message: <<EOD
1. With the NetBox 4.5 release Python 3.10 and 3.11 are officially no longer
   supported.  The whole code can still be compiled without any problems using
   Python 3.11, which is the current default version in the ports tree.

   Therefore, the minimum version for Python doesn't need to be raised for the
   time being, but this may change at any time as soon as backward-incompatible
   changes to the code lands into upstream for the next release.

   Thus, no further action is required at this time. However, it's still
   recommended to upgrade to Python 3.12 or newer in the near future.

2. Following items should be checked as well:

   * GraphQL API queries which filter by object IDs or enums must now specify a
     filter lookup similar to other fields. For example, "id: 123" becomes
     "id: {exact: 123 }".

   * Rendering a device or virtual machine configuration is now restricted to
     users with the render_config permission for the applicable object type.

   * Retrieval of API token plaintexts is no longer supported. The
     ALLOW_TOKEN_RETRIEVAL config parameter has been removed.

   * API tokens can no longer be reassigned from one user to another.

   * A config context assigned to a platform will now also apply to any
     children of that platform. (Although this is typically desired behavior,
     it may introduce unanticipated changes for existing deployments.)

   * The /api/dcim/cable-terminations/ REST API endpoint is now read-only.
     Cable terminations must be set on cables directly via the
     /api/dcim/cables/ endpoint.

   * The UI view dedicated to swapping A/Z circuit terminations has been
     removed.

   * The experimental HTMX navigation feature has been removed.

   * The obsolete boolean field is_staff has been removed from the User model.

   * Removal of deprecated behavior:

     * The /api/extras/object-types/ REST API endpoint has been removed.
       (Use /api/core/object-types/ instead.)

     * Webhooks no longer specify a model in payload data. (Reference
       "object_type" instead, which includes the parent app label.)

     * The obsolete module core.models.contenttypes has been removed (replaced
       in v4.4 by core.models.object_types).

     * The load_yaml() and load_json() utility methods have been removed from
       the base class for custom scripts.
EOD
}
{ type: upgrade
  maximum_version: 4.6.3
  message: <<EOD
1. NetBox 4.6 requires Python 3.12 or newer.

2. Please note that the command to build to offline documentation has been
   changed from "mkdocs build" to "zensical build".

   The general update instructions in this pkg-message and the netbox sample rc
   script (available via the EXAMPLES option) have also been updated
   accordingly.
EOD
}
]
