# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-08-18 09:32
from __future__ import unicode_literals

from django.db import migrations, models


def cleanup_tokens(apps, schema_editor):
    AuthToken = apps.get_model('knox', 'AuthToken')
    AuthToken.objects.filter(token_key__isnull=True).delete()


class Migration(migrations.Migration):

    dependencies = [
        ('knox', '0005_authtoken_token_key'),
    ]

    operations = [
        migrations.RunPython(cleanup_tokens),
        migrations.AlterField(
            model_name='authtoken',
            name='token_key',
            field=models.CharField(db_index=True, default='', max_length=8),
            preserve_default=False,
        ),
    ]
