<commit_before># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from replayswithfriends.sc2match.models import Match

class Migration(DataMigration):

    def forwards(self, orm):
        "Write your forwards methods here."
        # add the hashes
        for m in Match.objects.all():
            try:
                m.save()
                m.process()
            except:
                m.delete()

        lasthash = ''<commit_msg>bypass migration if there is no data to migrate<commit_after># -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from replayswithfriends.sc2match.models import Match

class Migration(DataMigration):

    def forwards(self, orm):
        "Write your forwards methods here."
        # add the hashes
        if not Match.objects.exists():
            return

        for m in Match.objects.all():
            try:
                m.save()
                m.process()
            except:
                m.delete()

        lasthash = ''
{'fraction_non_alphanumeric': 0.0878438331854481, 'fraction_numerical': 0.005323868677905945, 'mean_word_length': 1.922279792746114, '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': '5561360', 'n_tokens_mistral': 311, 'n_tokens_neox': 294, 'n_words': 100}