<commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-12-12 11:04
from __future__ import unicode_literals

from django.db import migrations


def forwards(apps, schema_editor):
    """
    Make every iOS device use APNS2 by default.
    """
    Device = apps.get_model('app', 'Device')

    # Query devices (~10.000) that have use_apns2=False and flip their bools.
    Device.objects.filter(use_apns2=False).update(use_apns2=True)


def backwards(apps, schema_editor):
    """
    Make every iOS device use APNS1 by default.
    """
    Device = apps.get_model('app', 'Device')

    # Query devices (~10.000) that have use_apns2=True and flip their bools.
    Device.objects.filter(use_apns2=True).update(use_apns2=False)


class Migration(migrations.Migration):

    dependencies = [
        ('app', '0006_remove_id_field'),
    ]

    operations = [migrations.RunPython(forwards, backwards)]
<commit_msg>Revert "Merge branch 'fix/fix-broken-migration' into develop"<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-12-12 11:04
from __future__ import unicode_literals

from django.db import migrations


def forwards(apps, schema_editor):
    """
    Make every iOS device use APNS2 by default.
    """
    Device = apps.get_model('app', 'Device')

    # Query devices (~10.000) that have use_apns2=False and flip their bools.
    Device.objects.filter(use_apns2=False).update(use_apns2=True)


def backwards(apps, schema_editor):
    """
    Make every iOS device use APNS1 by default.
    """
    Device = apps.get_model('app', 'Device')

    # Query devices (~10.000) that have use_apns2=True and flip their bools.
    Device.objects.filter(use_apns2=True).update(use_apns2=False)


class Migration(migrations.Migration):

    dependencies = [
        ('app', '0005_use_sip_user_id_as_pk_for_device'),
    ]

    operations = [migrations.RunPython(forwards, backwards)]

{'fraction_non_alphanumeric': 0.12116484659386376, 'fraction_numerical': 0.04160166406656266, 'mean_word_length': 3.798004987531172, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '7476271', 'n_tokens_mistral': 691, 'n_tokens_neox': 629, 'n_words': 157}