Django Migrations Check

Recently I learned a quick way to check if your migrations are up to date.

At work, I wrote something like this:

#!/bin/bash

pip install -r req/dev.txt

python manage.py makemigrations

git add .

if ! git diff-index --quiet HEAD --; then"
    exit 1
else
    exit 0
fi

It can be simplified with the following command

python manage.py makemigrations --check --dry-run

Hi!

I'm Daniil Kistanov. Welcome to my blog Subscribe

Currently, I work as a DevOps Engineer at Apple. My interests include Backend Engineering, Networking and Math related to CS.

You can reach out to me via LinkedIn or check my resume here.