Skip to main content

Automatically reverses Django migrations when changing git branches

Project description

great-scott

great-scott is a tool that can automatically reverse migrations in a Django project, when switching between different GIT branches.

InstallationUsageRemoving GIT hooks

doc

Installation

great-scott can be installed in 2 easy steps:

  1. Install the tool

    I recommend installing via pipx:

    pipx install great-scott
    

    Alternatively, having the project's virtual-env activated, you can of course install the tool directly into virtual-env:

    python -m pip install great-scott
    
  2. Setup GIT hooks

    After successful installation, while in the GIT-managed project folder and with virtual-env activated, execute:

    great-scott install
    

Usage

Reversing migrations should simply work when the GIT branch is changed:

$ 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!

👉 If you use GIT integration in any of the popular IDEs, such as PyCharm or VSCode, don't forget to properly configure the appropriate python environment there so that automatic reversing of migrations is possible.

Removing GIT hooks

To remove the GIT hooks, execute the command (while in the project directory and with virtual-env activated):

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.3.tar.gz (5.8 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.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for great_scott-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9697bdca21334ec04eaecdc4af4ec9848879ad3b4af92debe8befffd5429d09a
MD5 781a51b692db70994b962892a361c38d
BLAKE2b-256 349c3c20993d4c2aa1dcc469f256f3f0843d7466dd0244b4e6416f7136a0dd00

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for great_scott-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c3b596f8a4adbc62d02ad53656717206bac4509c25a387ed7e5e660131c04407
MD5 8afaccd8e9157d304fa4ef4a8d5c01b1
BLAKE2b-256 ce2912443b2cceeec766e45ffc1b07c4df3a7eb84aa5beb2bb4fe439ecc4677d

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