Repository URL to install this package:
|
Version:
0.0.1 ▾
|
#!/bin/bash
if [ $# -eq 0 ]
then
echo "No arguments supplied. Please specify the apps you'd like to reset migrations for."
exit 1
fi
echo "Are you sure you want to reset migrations for $@? Type in 'confirm' to confirm"
read confirmation
if [ $confirmation -ne 'confirm' ]
then
exit 1
fi
echo "Resetting the app tables in the database to zero..."
for app in $@ ; do
python manage.py migrate $app zero
done
echo "Removing old migrations files..."
for app in $@ ; do
rm $PACKAGE_NAME/${app}/migrations/0*.py
done
#echo "Creating new migrations"
#python manage.py makemigrations $@
#echo "Migrating the database"
#python manage.py migrate
#python manage.py redo_all_perms