<commit_before># encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models

class Migration(DataMigration):
    
    def forwards(self, orm):
        for centre in orm.Centre.objects.all():
            centre.centreid = centre.id
            centre.save()
            db.execute( "UPDATE tutordb_centre SET id = nextval('tutordb_centre_id_seq') WHERE id = %s", [ centre.id ] )
            db.execute( "UPDATE tutordb_tenure set centre_id = lastval() where centre_id = %s", [ centre.id ] )<commit_msg>make sure we do not clash with existing ids when shuffling them about<commit_after># encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models

class Migration(DataMigration):
    
    def forwards(self, orm):
        db.execute( "ALTER SEQUENCE tutordb_centre_id_seq RESTART WITH 1" )
        for centre in orm.Centre.objects.all().order_by('id'):
            centre.centreid = centre.id
            centre.save()
            db.execute( "UPDATE tutordb_centre SET id = nextval('tutordb_centre_id_seq') WHERE id = %s", [ centre.id ] )
            db.execute( "UPDATE tutordb_tenure set centre_id = lastval() where centre_id = %s", [ centre.id ] )
{'fraction_non_alphanumeric': 0.0991345397324941, 'fraction_numerical': 0.003933910306845004, 'mean_word_length': 3.116504854368932, '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': '6813686', 'n_tokens_mistral': 400, 'n_tokens_neox': 399, 'n_words': 117}