# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2017-10-24 20:12
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('mapdata', '0039_auto_20171024_2011'),
    ]

    operations = [
        migrations.CreateModel(
            name='AccessPermission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('expire_date', models.DateTimeField(null=True, verbose_name='expires')),
            ],
            options={
                'verbose_name': 'Access Permission',
                'verbose_name_plural': 'Access Permissions',
                'default_related_name': 'accesspermissions',
            },
        ),
        migrations.AddField(
            model_name='accessrestriction',
            name='open',
            field=models.BooleanField(default=False, verbose_name='open'),
        ),
        migrations.AddField(
            model_name='accesspermission',
            name='access_restriction',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='accesspermissions', to='mapdata.AccessRestriction'),
        ),
        migrations.AddField(
            model_name='accesspermission',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='accesspermissions', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='accessrestriction',
            name='users',
            field=models.ManyToManyField(related_name='accessrestrictions', through='mapdata.AccessPermission', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='accesspermission',
            unique_together=set([('user', 'access_restriction')]),
        ),
    ]
