# Generated by Django 3.1.2 on 2020-10-24 15:47

import django.contrib.postgres.fields
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name="TelegramUpdate",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                (
                    "update_id",
                    models.CharField(
                        help_text="This is a unique ID for each Update from Telegram",
                        max_length=128,
                        verbose_name="Telegram Update ID",
                    ),
                ),
                (
                    "bot",
                    models.CharField(
                        help_text="Displays the bot which has participated is in this update.",
                        max_length=32,
                        verbose_name="Telegram bot",
                    ),
                ),
                ("message", models.JSONField(blank=True, null=True, verbose_name="Telegram Update message")),
                (
                    "edited_message",
                    models.JSONField(blank=True, null=True, verbose_name="Telegram Update edited message"),
                ),
                ("channel_post", models.JSONField(blank=True, null=True, verbose_name="Telegram Update channel post")),
                (
                    "edited_channel_post",
                    models.JSONField(blank=True, null=True, verbose_name="Telegram Update edited channel post"),
                ),
                ("inline_query", models.JSONField(blank=True, null=True, verbose_name="Telegram Update inline query")),
                (
                    "chosen_inline_result",
                    models.JSONField(blank=True, null=True, verbose_name="Telegram Update chosen inline result"),
                ),
                (
                    "callback_query",
                    models.JSONField(blank=True, null=True, verbose_name="Telegram Update callback query"),
                ),
            ],
            options={
                "verbose_name": "Telegram Update",
                "verbose_name_plural": "Telegram Updates",
            },
        ),
        migrations.CreateModel(
            name="TelegramUser",
            fields=[
                (
                    "id",
                    models.BigIntegerField(
                        help_text="Telegram ID is a unique ID for each user which is help us tp identify users.",
                        primary_key=True,
                        serialize=False,
                        verbose_name="Telegram User ID",
                    ),
                ),
                (
                    "first_name",
                    models.CharField(blank=True, max_length=255, null=True, verbose_name="Telegram User First name"),
                ),
                (
                    "last_name",
                    models.CharField(blank=True, max_length=255, null=True, verbose_name="Telegram User Last name"),
                ),
                (
                    "username",
                    models.CharField(blank=True, max_length=255, null=True, verbose_name="Telegram User Username"),
                ),
                (
                    "is_bot",
                    models.BooleanField(
                        default=False,
                        help_text="Designates whether the account is a telegram bot or a human user.",
                        verbose_name="Telegram User IsBot",
                    ),
                ),
                (
                    "language_code",
                    models.CharField(blank=True, max_length=8, null=True, verbose_name="Telegram User Language code"),
                ),
                (
                    "bots",
                    django.contrib.postgres.fields.ArrayField(
                        base_field=models.CharField(
                            help_text="Displays the bots which have been interacted with this user.",
                            max_length=32,
                            verbose_name="Telegram bot",
                        ),
                        size=None,
                    ),
                ),
                ("date_met", models.DateTimeField(auto_now_add=True)),
                ("last_seen", models.DateTimeField(blank=True, null=True)),
                ("phone_number", models.CharField(max_length=16, unique=True, verbose_name="Phone number")),
                (
                    "site_user",
                    models.OneToOneField(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="telegram",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Connected Site User",
                    ),
                ),
            ],
            options={
                "verbose_name": "Telegram User",
                "verbose_name_plural": "Telegram Users",
            },
        ),
    ]
