Squash database migrations prior to v2.3 #1823

Closed
opened 2025-12-29 17:19:32 +01:00 by adam · 1 comment
Owner

Originally created by @jeremystretch on GitHub (Jul 2, 2018).

Issue type

[ ] Feature request
[ ] Bug report
[ ] Documentation
[x] Housekeeping

Environment

  • Python version: 3.5.2
  • NetBox version: 2.3.5

Description

Each time we make a change to the database schema (for example, adding a new field to a model), a migration containing the details of the change is generated. Over time, these migrations accumulate such that it takes slightly longer to construct a database with each new migration. Although migrations are applied only once each, either during the initial installation or an upgrade, they must all be applied each time a test is run. This means tests take somewhat longer than they need to.

It is possible to compress multiple migrations into one, provided they are linear in nature and reside in the same section of NetBox. Ideally, this should be done routinely, however we currently maintain all 120 or so individual migrations dating back to the original release. I'd like to begin squashing migrations with every minor release, beginning with v2.4.

Originally created by @jeremystretch on GitHub (Jul 2, 2018). ### Issue type [ ] Feature request <!-- An enhancement of existing functionality --> [ ] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> [x] Housekeeping <!-- Changes pertaining to the codebase itself --> ### Environment * Python version: 3.5.2 * NetBox version: 2.3.5 ### Description Each time we make a change to the database schema (for example, adding a new field to a model), a migration containing the details of the change is generated. Over time, these migrations accumulate such that it takes slightly longer to construct a database with each new migration. Although migrations are applied only once each, either during the initial installation or an upgrade, they must all be applied each time a test is run. This means tests take somewhat longer than they need to. It is possible to compress multiple migrations into one, provided they are linear in nature and reside in the same section of NetBox. Ideally, this should be done routinely, however we currently maintain all 120 or so individual migrations dating back to the original release. I'd like to begin squashing migrations with every minor release, beginning with v2.4.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 17:19:32 +01:00
adam closed this issue 2025-12-29 17:19:32 +01:00
Author
Owner

@madeinoz67 commented on GitHub (Jul 5, 2018):

make sense

@madeinoz67 commented on GitHub (Jul 5, 2018): make sense
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1823