<commit_before># -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-01-12 07:47
from __future__ import unicode_literals

from django import db
from django.db import migrations


def copy_gestalten(apps, schema_editor):
    Gestalt1 = apps.get_model('entities.Gestalt')
    Gestalt2 = apps.get_model('gestalten.Gestalt')
    for g in Gestalt1.objects.order_by('id'):
        g2 = Gestalt2.objects.create(
                id=g.id,
                about=g.about,
                avatar=g.avatar,
                avatar_color=g.avatar_color,
                background=g.background,
                public=g.public,
                user=g.user)
    if Gestalt1.objects.all():
        max_id = Gestalt1.objects.order_by('id').last().id
        id = Gestalt1.objects.first().id
        while id <= max_id:
            try:
                g = Gestalt2.objects.create()
                id = g.id
                g.delete()<commit_msg>fix migration transaction errors in gestalten feature<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-01-12 07:47
from __future__ import unicode_literals

from django import db
from django.db import migrations, transaction


def copy_gestalten(apps, schema_editor):
    Gestalt1 = apps.get_model('entities.Gestalt')
    Gestalt2 = apps.get_model('gestalten.Gestalt')
    for g in Gestalt1.objects.order_by('id'):
        Gestalt2.objects.create(
                id=g.id,
                about=g.about,
                avatar=g.avatar,
                avatar_color=g.avatar_color,
                background=g.background,
                public=g.public,
                user=g.user)
    if Gestalt1.objects.all():
        max_id = Gestalt1.objects.order_by('id').last().id
        id = Gestalt1.objects.first().id
        while id <= max_id:
            try:
                with transaction.atomic():
                    g = Gestalt2.objects.create()
                    id = g.id
                    g.delete()
{'fraction_non_alphanumeric': 0.10846426761277243, 'fraction_numerical': 0.025848960973137353, 'mean_word_length': 1.8484848484848484, 'pattern_counts': {'":': 0, '<': 5, '<?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': '4889243', 'n_tokens_mistral': 642, 'n_tokens_neox': 590, 'n_words': 121}