Skip to main content

Automatically reverses Django migrations when changing git branches

Project description

great-scott

great-scott automatically reverses migrations in a Django project when switching between Git branches.

InstallationUsageRemoving Git hooks

doc

Installation

  1. Install the tool

    Via uv (recommended):

    uv tool install great-scott
    

    Via pipx:

    pipx install great-scott
    

    Or directly into the project's virtual environment:

    python -m pip install great-scott
    
  2. Set up Git hooks

    From the project directory, run:

    great-scott install
    

Usage

Migrations are reversed automatically when switching branches:

$ git checkout main
Switched to branch 'main'
👀 Looking for migrations to reverse on mig-test...
⚠️ reversing migrations for importer (up to 0015)
⚠️ reversing migrations for permissions (up to 0018)
⚠️ reversing migrations for subscriptions (up to 0044)
I have reversed migrations for 3 apps!

IDE users: If you switch branches via PyCharm, VSCode, or another IDE's Git integration, make sure the IDE is configured to use the correct Python environment - otherwise automatic migration reversal may not trigger.

Removing Git hooks

From the project directory, run:

great-scott uninstall

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

great_scott-0.1.5.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

great_scott-0.1.5-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file great_scott-0.1.5.tar.gz.

File metadata

  • Download URL: great_scott-0.1.5.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.13.5 Darwin/25.5.0

File hashes

Hashes for great_scott-0.1.5.tar.gz
Algorithm Hash digest
SHA256 2c703d19bcbd45f4e973d7bf8213518ebe1d483f3ce555543da26af174142ca8
MD5 1b8c23e729171120196c087618b4986f
BLAKE2b-256 61dd3c4c61e0931cfb5439d19aa694189464adb3fe05f3063930f9659e76a04c

See more details on using hashes here.

File details

Details for the file great_scott-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: great_scott-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.13.5 Darwin/25.5.0

File hashes

Hashes for great_scott-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 99e162051b2c30d0a9c6a79b2c458ccf2ac70df4b069d783ddd95ee626d0f79c
MD5 6f4be36909893664c5cb21a133b24948
BLAKE2b-256 76dbc165dbec2716ed346ab190147729592ab3f108c144dc129349dd31d79f01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page