# Generated by Django 2.1 on 2018-09-12 10:35

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

import pretix.base.models.devices


class Migration(migrations.Migration):

    dependencies = [
        ('pretixbase', '0098_auto_20180731_1243_squashed_0100_item_require_approval'),
    ]

    operations = [
        migrations.CreateModel(
            name='Device',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('device_id', models.PositiveIntegerField()),
                ('unique_serial', models.CharField(default=pretix.base.models.devices.generate_serial, max_length=190, unique=True)),
                ('initialization_token', models.CharField(default=pretix.base.models.devices.generate_initialization_token, max_length=190, unique=True)),
                ('api_token', models.CharField(max_length=190, null=True, unique=True)),
                ('all_events', models.BooleanField(default=False, verbose_name='All events (including newly created ones)')),
                ('name', models.CharField(max_length=190, verbose_name='Name')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Setup date')),
                ('initialized', models.DateTimeField(null=True, verbose_name='Initialization date')),
                ('hardware_brand', models.CharField(blank=True, max_length=190, null=True)),
                ('hardware_model', models.CharField(blank=True, max_length=190, null=True)),
                ('software_brand', models.CharField(blank=True, max_length=190, null=True)),
                ('software_version', models.CharField(blank=True, max_length=190, null=True)),
                ('limit_events', models.ManyToManyField(blank=True, to='pretixbase.Event', verbose_name='Limit to events')),
                ('organizer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='devices', to='pretixbase.Organizer')),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='device',
            unique_together={('organizer', 'device_id')},
        ),
        migrations.AddField(
            model_name='logentry',
            name='device',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='pretixbase.Device'),
        ),
    ]
