@ -12,10 +12,13 @@ falha ()
exit 1
}
# se há algum model no commit
if git diff --cached --name-status | grep -q '^M.*models\.py$'; then
# deve haver alguma migration nova no commit
if ! git diff --cached --name-status | grep -q '^A.*/migrations/[[:digit:]]\{4\}_.*\.py$'; then
falha
fi
# a verificação de migrations pendentes deve passar