<commit_before>#!/usr/bin/env bash
#
# Rather verbose and destructive script to create both South migrations and
# the new native migrations. This will install and uninstall Django versions
# in your virtualenv, only work with the default SQLite database, destroy that
# database repeatedly

pip uninstall Django South -y

# Commit of the stable/1.7.x branch that contains fix for https://code.djangoproject.com/ticket/23041,
# but doesn't suffer from https://code.djangoproject.com/ticket/23014
pip install https://github.com/django/django/archive/88135a8cf7d587b88e47f1223cf01c7698b52b74.zip
rm -f sites/sandbox/db.sqlite
sites/sandbox/manage.py migrate
sites/sandbox/manage.py makemigrations analytics checkout address shipping catalogue reviews partner basket payment offer order customer promotions search voucher wishlists

pip uninstall Django -y
pip install Django==1.6.5 South==1.0
rm -f sites/sandbox/db.sqlite
sites/sandbox/manage.py syncdb --noinput
sites/sandbox/manage.py migrate
sites/sandbox/manage.py schemamigration analytics --auto
sites/sandbox/manage.py schemamigration checkout --auto
sites/sandbox/manage.py schemamigration address --auto
sites/sandbox/manage.py schemamigration shipping --auto
sites/sandbox/manage.py schemamigration catalogue --auto
sites/sandbox/manage.py schemamigration reviews --auto
sites/sandbox/manage.py schemamigration partner --auto
sites/sandbox/manage.py schemamigration basket --auto
sites/sandbox/manage.py schemamigration payment --auto
sites/sandbox/manage.py schemamigration offer --auto
sites/sandbox/manage.py schemamigration order --auto
sites/sandbox/manage.py schemamigration customer --auto
sites/sandbox/manage.py schemamigration promotions --auto
sites/sandbox/manage.py schemamigration search --auto
sites/sandbox/manage.py schemamigration voucher --auto
sites/sandbox/manage.py schemamigration wishlists --auto

pip uninstall Django -y<commit_msg>Improve create_migration script<commit_after>#!/usr/bin/env bash
#
# Rather verbose and destructive script to create both South migrations and the
# new native migrations (which we need as we support both Django 1.6 and 1.7).
# This will install and uninstall Django versions in your virtualenv, only work
# with the default SQLite database, destroy that database repeatedly

# Grab current version of Django from virtualenv
DJANGO_VERSION=$(pip freeze | awk 'BEGIN {FS="=="} /Django/ {print $2}')
SOUTH_VERSION=$(pip freeze | awk 'BEGIN {FS="=="} /South/ {print $2}')

APPS=( analytics checkout address shipping catalogue reviews partner basket payment \
       offer order customer promotions search voucher wishlists )

echo "Uninstalling Django(==$DJANGO_VERSION) and South(==$SOUTH_VERSION)"
pip uninstall Django South -y

echo "Generating Django-native (>=1.7) migrations"
# Commit of the stable/1.7.x branch that contains fix for https://code.djangoproject.com/ticket/23041,
# but doesn't suffer from https://code.djangoproject.com/ticket/23014
pip install https://github.com/django/django/archive/88135a8cf7d587b88e47f1223cf01c7698b52b74.zip
rm -f sites/sandbox/db.sqlite
sites/sandbox/manage.py migrate
sites/sandbox/manage.py makemigrations ${APPS[@]}

echo "Generating Django 1.6 migrations"
pip install "Django==1.6.5" "South==1.0"
rm -f sites/sandbox/db.sqlite
sites/sandbox/manage.py syncdb --noinput
sites/sandbox/manage.py migrate
for APP in "${APPS[@]}"
do
    sites/sandbox/manage.py schemamigration $APP --auto
done

echo "Restoring Django(==$DJANGO_VERSION) and South(==$SOUTH_VERSION)"
pip install "Django==$DJANGO_VERSION" "South==$SOUTH_VERSION"
{'fraction_non_alphanumeric': 0.09765625, 'fraction_numerical': 0.027901785714285716, 'mean_word_length': 5.20242214532872, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6675495', 'n_tokens_mistral': 1273, 'n_tokens_neox': 1070, 'n_words': 335}