Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
dj-kaos-dev-utils / scripts / reset-migrations
Size: Mime:
#!/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