<commit_before># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models, utils
import pickle

class Migration(SchemaMigration):

    def forwards(self, orm):
        try:
            db.rename_table("config_configvalue", "server_serverconfig")    
            for conf in orm.ServerConfig.objects.all():
                conf.db_value = pickle.dumps(conf.db_value)
                conf.save()
        except utils.DatabaseError:
            # this will happen if we start db from scratch (the config
            # app will then already be gone and no data is to be transferred)
            # So instead of renaming the old we instead have to manually create the new model.
            # Adding model 'ServerConfig' 
            db.create_table('server_serverconfig', (
                    ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
                    ('db_key', self.gf('django.db.models.fields.CharField')(unique=True, max_length=64)),
                    ('db_value', self.gf('django.db.models.fields.TextField')(blank=True)),
                    ))
            db.send_create_signal('server', ['ServerConfig'])
            
    def backwards(self, orm):
        raise RuntimeError("This migration cannot be reversed.")

    models = {
        'config.configvalue': {
            'Meta': {'object_name': 'ConfigValue'},
            'db_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
            'db_value': ('django.db.models.fields.TextField', [], {}),<commit_msg>Fixed a migration that failed under mysql.<commit_after># encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models, utils
import pickle

class Migration(SchemaMigration):
    
    no_dry_run = True 
    def forwards(self, orm):
        try:
            db.rename_table("config_configvalue", "server_serverconfig")    
            for conf in orm.ServerConfig.objects.all():
                conf.db_value = pickle.dumps(conf.db_value)
                conf.save()
        except Exception: #utils.DatabaseError:
            # this will happen if we start db from scratch (the config
            # app will then already be gone and no data is to be transferred)
            # So instead of renaming the old we instead have to manually create the new model.
            # Adding model 'ServerConfig' 
            db.create_table('server_serverconfig', (
                    ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
                    ('db_key', self.gf('django.db.models.fields.CharField')(unique=True, max_length=64)),
                    ('db_value', self.gf('django.db.models.fields.TextField')(blank=True)),
                    ))
            db.send_create_signal('server', ['ServerConfig'])
            
    def backwards(self, orm):
        raise RuntimeError("This migration cannot be reversed.")

    models = {
        'config.configvalue': {
            'Meta': {'object_name': 'ConfigValue'},
            'db_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
            'db_value': ('django.db.models.fields.TextField', [], {}),
{'fraction_non_alphanumeric': 0.12317073170731707, 'fraction_numerical': 0.00426829268292683, 'mean_word_length': 2.392967942088935, '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': '5662060', 'n_tokens_mistral': 910, 'n_tokens_neox': 879, 'n_words': 233}