Created
November 14, 2020 04:04
-
-
Save antibagr/3d399d404dc4b062c85dae89b6273292 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: ======================================== | |
:: Easy way to make migrations on Django project | |
:: Replace YOUR_APP_NAME on line 13 with your actual Django app name | |
:: Made for fun by Rudolf Nemov | |
:: https://github.com/antibagr | |
echo Starting migration ... | |
set app_name=YOUR_APP_NAME | |
for /F "tokens=* USEBACKQ" %%F IN (`python manage.py makemigrations %app_name%`) DO ( | |
SET migration_status=%%F | |
) | |
if /i "%migration_status:~0,2%"=="No" ( | |
echo No changes detected in "%app_name%" | |
goto EOF | |
) else ( | |
echo %migration_status% | |
python manage.py migrate | |
) | |
:EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment