<commit_before># Generated by Django 2.2.13 on 2020-10-09 19:09

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('models', '6492_add_date_datatype_configs'),
    ]

    operations = [
        migrations.AddConstraint(
            model_name='node',
            constraint=models.UniqueConstraint(fields=('name', 'nodegroup'), name='unique_nodename_nodegroup'),
        ),
    ]<commit_msg>Add SQL to rename duplicate node names, re #6700<commit_after># Generated by Django 2.2.13 on 2020-10-09 19:09

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('models', '6492_add_date_datatype_configs'),
    ]

    operations = [
        migrations.RunSQL(
            """
                UPDATE nodes AS n1
                SET name = n1.name || '_' || nodeid
                WHERE EXISTS (
                    SELECT n1.nodeid
                    FROM nodes AS n2
                    WHERE n1.nodeid <> n2.nodeid
                    AND n1.name = n2.name
                    AND n1.nodegroupid = n2.nodegroupid
                );
            """,
        ),
        migrations.AddConstraint(
            model_name='node',
            constraint=models.UniqueConstraint(fields=('name', 'nodegroup'), name='unique_nodename_nodegroup'),
        ),
    ]
{'fraction_non_alphanumeric': 0.10422740524781342, 'fraction_numerical': 0.03935860058309038, 'mean_word_length': 1.8966244725738397, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2136431', 'n_tokens_mistral': 426, 'n_tokens_neox': 381, 'n_words': 82}