Skip to content

Enable database migrations with open branches #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jeremystretch opened this issue Jul 19, 2024 · 1 comment
Open

Enable database migrations with open branches #1

jeremystretch opened this issue Jul 19, 2024 · 1 comment
Assignees
Labels
app: branching complexity: high Expected to require a large amont of time and effort to implement relative to other tasks status: accepted type: feature A new feature or functionality
Milestone

Comments

@jeremystretch
Copy link
Contributor

Plugin Version

v0.2.0

Proposed functionality

Implement the ability to apply database migrations (e.g. from a NetBox upgrade) with one or more open branches. Currently, this is not supported as migration operations are applied only to the main schema.

Use case

This would enable users to reliably upgrade to new NetBox versions without needing to first merge any open branches.

External dependencies

No response

@jeremystretch
Copy link
Contributor Author

jeremystretch commented May 15, 2025

Several prerequisite items of work were identified and completed in the process of implementing this feature.

  • NetBox bug #19440: All data migrations needed to be adjusted to ensure they are applied using the database connection provided by the schema editor to support application to a branch; otherwise, they default to the main schema. Fixed in NetBox v4.3.1.

  • NetBox bug #19444: The data model for contact group assignments needed to be adjusted to restore change logging support. (This needed to be fixed regardless to ensure branching support, but was an immediate blocker for this FR.) Fixed in NetBox v4.3.1.

  • netbox-branching bug #251: SQL index names were not being preserved when replicating tables from main into the branch schema. The fix for this implements a migration to correct existing branches in addition to addressing the process for provisioning new branches. Fixed in netbox-branching v0.5.5.

As successful migration of a branch depends crucially on the fix for NetBox bug #19440, the inclusion of this feature will necessitate raising the minimum NetBox version to v4.3.1. However, it should be possible to migrate existing branches from as far back as NetBox v4.1.0 (when branching support was first introduced).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app: branching complexity: high Expected to require a large amont of time and effort to implement relative to other tasks status: accepted type: feature A new feature or functionality
Projects
None yet
Development

No branches or pull requests

2 participants