[PR #19628] [MERGED] Closes #19627: Object change migrators #15682

Closed
opened 2025-12-30 00:23:23 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/19628
Author: @jeremystretch
Created: 6/2/2025
Status: Merged
Merged: 6/5/2025
Merged by: @jeremystretch

Base: mainHead: 19627-object-change-migrators


📝 Commits (7)

  • 1a5cb5a Initial work on ObjectChange data migrations
  • ef0a686 Fix migration bug
  • 354c5dc Add migrators for MAC address assignments
  • 5a0d33a Update reverting kwarg; allow pop() to fail
  • 71ee2a9 Cross-reference MAC address migrators
  • d223c01 Split migrator logic across migrations
  • b51a3a1 Add missing migrator

📊 Changes

13 files changed (+261 additions, -1 deletions)

View changed files

📝 netbox/circuits/migrations/0047_circuittermination__termination.py (+24 -0)
📝 netbox/circuits/migrations/0048_circuitterminations_cached_relations.py (+12 -0)
📝 netbox/circuits/migrations/0051_virtualcircuit_group_assignment.py (+19 -0)
📝 netbox/dcim/migrations/0188_racktype.py (+13 -0)
📝 netbox/dcim/migrations/0200_populate_mac_addresses.py (+43 -1)
📝 netbox/ipam/migrations/0071_prefix_scope.py (+18 -0)
📝 netbox/ipam/migrations/0072_prefix_cached_relations.py (+11 -0)
📝 netbox/ipam/migrations/0080_populate_service_parent.py (+24 -0)
📝 netbox/ipam/migrations/0081_remove_service_device_virtual_machine_add_parent_gfk_index.py (+12 -0)
📝 netbox/tenancy/migrations/0018_contact_groups.py (+14 -0)
📝 netbox/virtualization/migrations/0044_cluster_scope.py (+18 -0)
📝 netbox/virtualization/migrations/0045_clusters_cached_relations.py (+11 -0)
📝 netbox/virtualization/migrations/0048_populate_mac_addresses.py (+42 -0)

📄 Description

Closes: #19627

Provide ObjectChange data migrators for schema migrations starting with NetBox v4.2.0:

  • circuits.0047_circuittermination__termination
  • circuits.0051_virtualcircuit_group_assignment
  • dcim.0200_populate_mac_addresses
  • ipam.0071_prefix_scope
  • ipam.0080_populate_service_parent
  • tenancy.0018_contact_groups
  • virtualization.0044_cluster_scope
  • virtualization.0048_populate_mac_addresses

The order of operations necessary for testing this PR in conjunction with the netbox-branching plugin as as follows.

  1. Install NetBox v4.1.9 and populate some data.
  2. Install and enable netbox-branching by checking out the main branch of the repo. (We need FR #262 but v0.5.6 hasn't been released yet.)
  3. Create branches and perform object changes to generate branch data for testing.
  4. Upgrade to NetBox v4.3.1, then switch to the branch for this PR (19627-object-change-migrators).
  5. Check out the 1-branch-migrations branch of netbox-branching. (This emulates upgrading to v0.6.0 of the plugin.)
  6. Test migrating and merging open branches that were created under NetBox v4.1.9.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/19628 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 6/2/2025 **Status:** ✅ Merged **Merged:** 6/5/2025 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `main` ← **Head:** `19627-object-change-migrators` --- ### 📝 Commits (7) - [`1a5cb5a`](https://github.com/netbox-community/netbox/commit/1a5cb5a9f9feac652bcea62668948d18c1af237d) Initial work on ObjectChange data migrations - [`ef0a686`](https://github.com/netbox-community/netbox/commit/ef0a68641739cd5f96e8ac3d368a89a3f1406d76) Fix migration bug - [`354c5dc`](https://github.com/netbox-community/netbox/commit/354c5dc1c5757bf8d532f447ca7f2770e75bafb4) Add migrators for MAC address assignments - [`5a0d33a`](https://github.com/netbox-community/netbox/commit/5a0d33a4a819590cfc12104fe09061b471f03df6) Update reverting kwarg; allow pop() to fail - [`71ee2a9`](https://github.com/netbox-community/netbox/commit/71ee2a996e153507973e38398a18c4bbfaa9755d) Cross-reference MAC address migrators - [`d223c01`](https://github.com/netbox-community/netbox/commit/d223c01dcdd0dc44275695a4b9d8ea29ee0f27fa) Split migrator logic across migrations - [`b51a3a1`](https://github.com/netbox-community/netbox/commit/b51a3a1710e7a7db78cdd5b6a993a4aea79e75d7) Add missing migrator ### 📊 Changes **13 files changed** (+261 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `netbox/circuits/migrations/0047_circuittermination__termination.py` (+24 -0) 📝 `netbox/circuits/migrations/0048_circuitterminations_cached_relations.py` (+12 -0) 📝 `netbox/circuits/migrations/0051_virtualcircuit_group_assignment.py` (+19 -0) 📝 `netbox/dcim/migrations/0188_racktype.py` (+13 -0) 📝 `netbox/dcim/migrations/0200_populate_mac_addresses.py` (+43 -1) 📝 `netbox/ipam/migrations/0071_prefix_scope.py` (+18 -0) 📝 `netbox/ipam/migrations/0072_prefix_cached_relations.py` (+11 -0) 📝 `netbox/ipam/migrations/0080_populate_service_parent.py` (+24 -0) 📝 `netbox/ipam/migrations/0081_remove_service_device_virtual_machine_add_parent_gfk_index.py` (+12 -0) 📝 `netbox/tenancy/migrations/0018_contact_groups.py` (+14 -0) 📝 `netbox/virtualization/migrations/0044_cluster_scope.py` (+18 -0) 📝 `netbox/virtualization/migrations/0045_clusters_cached_relations.py` (+11 -0) 📝 `netbox/virtualization/migrations/0048_populate_mac_addresses.py` (+42 -0) </details> ### 📄 Description ### Closes: #19627 Provide ObjectChange data migrators for schema migrations starting with NetBox v4.2.0: * circuits.0047_circuittermination__termination * circuits.0051_virtualcircuit_group_assignment * dcim.0200_populate_mac_addresses * ipam.0071_prefix_scope * ipam.0080_populate_service_parent * tenancy.0018_contact_groups * virtualization.0044_cluster_scope * virtualization.0048_populate_mac_addresses The order of operations necessary for testing this PR in conjunction with the netbox-branching plugin as as follows. 1. Install NetBox v4.1.9 and populate some [data](https://github.com/netbox-community/netbox-demo-data/blob/master/sql/netbox-demo-v4.1.sql). 2. Install and enable [netbox-branching](https://github.com/netboxlabs/netbox-branching) by checking out the `main` branch of the repo. (We need FR [#262](https://github.com/netboxlabs/netbox-branching/issues/262) but v0.5.6 hasn't been released yet.) 3. Create branches and perform object changes to generate branch data for testing. 4. Upgrade to NetBox v4.3.1, then switch to the branch for this PR (`19627-object-change-migrators`). 5. Check out the `1-branch-migrations` branch of netbox-branching. (This emulates upgrading to v0.6.0 of the plugin.) 6. Test migrating and merging open branches that were created under NetBox v4.1.9. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:23:23 +01:00
adam closed this issue 2025-12-30 00:23:23 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15682