# Generated by Django 3.1.1 on 2021-02-01 13:00

import uuid

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

import redlink.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="RedlinkDevice",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        help_text="Unique device identifier",
                        primary_key=True,
                        serialize=False,
                        unique=True,
                        verbose_name="Device ID",
                    ),
                ),
                ("registration_id", models.TextField()),
                (
                    "name",
                    models.CharField(max_length=255, null=True, verbose_name="Name"),
                ),
                ("active", models.BooleanField(default=True)),
                (
                    "type",
                    models.CharField(
                        choices=[("ios", "ios"), ("android", "android")], max_length=10
                    ),
                ),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("updated", models.DateTimeField(auto_now=True)),
                (
                    "user",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="redlink_devices",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={"abstract": False,},
            bases=(redlink.models.RedlinkClientMixin, models.Model),
        ),
        migrations.CreateModel(
            name="DeviceNotificationSettings",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("marketing", models.BooleanField(default=True)),
                ("transactional", models.BooleanField(default=True)),
                (
                    "device",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="settings",
                        to="appchance_redlink.redlinkdevice",
                    ),
                ),
            ],
            options={"abstract": False,},
        ),
    ]
