Description
Currently, the auditlog app contains multiple sequential migration files (0001 → 0017). While this works well for incremental upgrades, fresh installations are required to execute all migration files individually.
This enhancement proposes introducing a squashed migration that consolidates the existing migrations into a single migration for new installations.
Proposed Improvement
-
Generate a squashed migration:
python manage.py squashmigrations auditlog 0001 0017
-
Provide a consolidated migration file (e.g., 0001_squashed.py)
-
Maintain backward compatibility using Django’s replaces = [...] mechanism
-
Ensure existing installations continue to upgrade without disruption
Benefits
-
Faster Fresh Installations
- New setups will execute only one migration instead of 17.
- Reduces migration time during project initialization.
-
Cleaner Migration Structure
- Less migration clutter.
- Easier long-term maintenance.
-
Improved Developer Experience
- Simpler onboarding.
- Clearer migration history.
-
CI/CD Optimization
- Reduces migration overhead in automated deployments and containerized environments.
This improvement would especially benefit projects like Horilla CRM, where frequent fresh deployments are performed across multiple environments.
Description
Currently, the
auditlogapp contains multiple sequential migration files (0001 → 0017). While this works well for incremental upgrades, fresh installations are required to execute all migration files individually.This enhancement proposes introducing a squashed migration that consolidates the existing migrations into a single migration for new installations.
Proposed Improvement
Generate a squashed migration:
Provide a consolidated migration file (e.g.,
0001_squashed.py)Maintain backward compatibility using Django’s
replaces = [...]mechanismEnsure existing installations continue to upgrade without disruption
Benefits
Faster Fresh Installations
Cleaner Migration Structure
Improved Developer Experience
CI/CD Optimization
This improvement would especially benefit projects like Horilla CRM, where frequent fresh deployments are performed across multiple environments.