# Generated by Django 2.2.1 on 2019-05-04 16:40

from django.db import migrations


def move_tokens_forward(apps, schema_editor):
    AssignedContent = apps.get_model('spider_base', 'AssignedContent')
    UserComponent = apps.get_model('spider_base', 'UserComponent')
    for row in AssignedContent.objects.all():
        if row.token:
            row.token = '_'.join(row.token.split("/"))
        row.save()
    for row in UserComponent.objects.all():
        if row.token:
            row.token = '_'.join(row.token.split("/"))
        row.save()


class Migration(migrations.Migration):

    dependencies = [
        ('spider_base', '0016_auto_20190414_1743'),
    ]

    operations = [
        migrations.RunPython(move_tokens_forward),
    ]
