# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-12-06 16:03
from __future__ import unicode_literals

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

import pretix.base.models.auth


class Migration(migrations.Migration):

    dependencies = [
        ('pretixbase', '0077_auto_20171124_1629'),
    ]

    operations = [
        migrations.CreateModel(
            name='NotificationSetting',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('action_type', models.CharField(max_length=255)),
                ('method', models.CharField(choices=[('mail', 'E-mail')], max_length=255)),
                ('event', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='pretixbase.Event')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('enabled', models.BooleanField(default=True)),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='notificationsetting',
            unique_together=set([('user', 'action_type', 'event', 'method')]),
        ),
        migrations.AddField(
            model_name='logentry',
            name='visible',
            field=models.BooleanField(default=True),
        ),
        migrations.AlterField(
            model_name='notificationsetting',
            name='event',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='notification_settings', to='pretixbase.Event'),
        ),
        migrations.AlterField(
            model_name='notificationsetting',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notification_settings', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='user',
            name='notifications_send',
            field=models.BooleanField(default=True, help_text='If turned off, you will not get any notifications.', verbose_name='Receive notifications according to my settings below'),
        ),
        migrations.AddField(
            model_name='user',
            name='notifications_token',
            field=models.CharField(default=pretix.base.models.auth.generate_notifications_token, max_length=255),
        ),
    ]
