<commit_before># encoding: utf-8
from south.db import db
from south.v2 import SchemaMigration


class Migration(SchemaMigration):

    depends_on = (
        ('igadget', '0002_auto__del_field_variable_abstract_variable'),
        ('connectable', '0003_auto__del_field_out_abstract_variable__add_field_out_variable__del_fie'),
    )

    def forwards(self, orm):

        # Work around problems with constraint cache
        db._constraint_cache = {}

        # Deleting model 'WorkSpaceVariable'
        db.delete_table('workspace_workspacevariable')

        # Deleting field 'Tab.abstract_variable'
        db.delete_column('workspace_tab', 'abstract_variable_id')

        # Adding field 'VariableValue.variable'
        db.add_column('workspace_variablevalue', 'variable', self.gf('django.db.models.fields.related.ForeignKey')(default=0, to=orm['igadget.Variable']))

        #for value in orm.VariableValue.objects.all():
        #    try:
        #        value.variable = orm['igadget.Variable'].objects.get(abstract_variable=value.abstract_variable)
        #    except orm['igadget.Variable'].DoesNotExists:
        #        value.delete()

        #db.alter_column('workspace_variablevalue', 'variable', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['igadget.Variable']))

        # Deleting field 'VariableValue.abstract_variable'
        db.delete_column('workspace_variablevalue', 'abstract_variable_id')

        # Deleting model 'AbstractVariable'
        db.delete_table('workspace_abstractvariable')<commit_msg>refs #88. Remove unneeded work arround in the migration code<commit_after># encoding: utf-8
from south.db import db
from south.v2 import SchemaMigration


class Migration(SchemaMigration):

    depends_on = (
        ('igadget', '0002_auto__del_field_variable_abstract_variable'),
        ('connectable', '0003_auto__del_field_out_abstract_variable__add_field_out_variable__del_fie'),
    )

    def forwards(self, orm):

        # Deleting model 'WorkSpaceVariable'
        db.delete_table('workspace_workspacevariable')

        # Deleting field 'Tab.abstract_variable'
        db.delete_column('workspace_tab', 'abstract_variable_id')

        # Adding field 'VariableValue.variable'
        db.add_column('workspace_variablevalue', 'variable', self.gf('django.db.models.fields.related.ForeignKey')(default=0, to=orm['igadget.Variable']))

        #for value in orm.VariableValue.objects.all():
        #    try:
        #        value.variable = orm['igadget.Variable'].objects.get(abstract_variable=value.abstract_variable)
        #    except orm['igadget.Variable'].DoesNotExists:
        #        value.delete()

        #db.alter_column('workspace_variablevalue', 'variable', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['igadget.Variable']))

        # Deleting field 'VariableValue.abstract_variable'
        db.delete_column('workspace_variablevalue', 'abstract_variable_id')

        # Deleting model 'AbstractVariable'
        db.delete_table('workspace_abstractvariable')
{'fraction_non_alphanumeric': 0.11395730706075534, 'fraction_numerical': 0.007881773399014778, 'mean_word_length': 3.8426073131955483, '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': '3234277', 'n_tokens_mistral': 910, 'n_tokens_neox': 879, 'n_words': 133}