Skip to content

Enhancement: Provide Squashed Migration for auditlog App #802

@KSreethul

Description

@KSreethul

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

  1. Faster Fresh Installations

    • New setups will execute only one migration instead of 17.
    • Reduces migration time during project initialization.
  2. Cleaner Migration Structure

    • Less migration clutter.
    • Easier long-term maintenance.
  3. Improved Developer Experience

    • Simpler onboarding.
    • Clearer migration history.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions