# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-12-10 02:10
from __future__ import unicode_literals

import c3nav.mapdata.models.access
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('mapdata', '0055_grant_access_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='AccessPermissionToken',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('valid_until', models.DateTimeField(db_index=True, default=c3nav.mapdata.models.access.default_valid_until, verbose_name='valid until')),
                ('unlimited', models.BooleanField(db_index=True, default=False, verbose_name='unlimited')),
                ('redeemed', models.BooleanField(db_index=True, default=False, verbose_name='redeemed')),
                ('can_grant', models.BooleanField(db_index=True, default=False, verbose_name='can grant')),
                ('data', models.BinaryField()),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='created_accesspermission_tokens', to=settings.AUTH_USER_MODEL, verbose_name='author')),
                ('redeemed_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='redeemed_accesspermission_tokens', to=settings.AUTH_USER_MODEL, verbose_name='redeemed by')),
            ],
        ),
    ]
