# Generated by Django 3.1.6 on 2021-09-14 13:58

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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Adjust",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("game", models.CharField(max_length=50)),
                ("app_token", models.CharField(max_length=50)),
                ("authorization_token", models.CharField(max_length=50)),
                ("purchase_event_token", models.CharField(max_length=50)),
                (
                    "platform",
                    models.CharField(
                        choices=[("ios", "Ios"), ("android", "Android")], max_length=20
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "Adjust",
            },
        ),
        migrations.CreateModel(
            name="AdjustLog",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("request_url", models.URLField()),
                ("response", models.JSONField()),
                ("request_data", models.JSONField()),
                ("request_headers", models.JSONField()),
                ("created_at", models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name="AppsFlyer",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("game", models.CharField(max_length=50)),
                ("app_id", models.CharField(max_length=100)),
                ("dev_key", models.CharField(max_length=300)),
                (
                    "platform",
                    models.CharField(
                        choices=[("ios", "Ios"), ("android", "Android")], max_length=20
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "AppsFlyer",
            },
        ),
        migrations.CreateModel(
            name="Config",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("game", models.CharField(max_length=50)),
                (
                    "platform",
                    models.CharField(
                        choices=[("ios", "Ios"), ("android", "Android")], max_length=20
                    ),
                ),
                ("is_fb_log_enabled", models.BooleanField(default=True)),
                ("is_af_log_enabled", models.BooleanField(default=True)),
                ("is_adjust_log_enabled", models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name="Facebook",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("game", models.CharField(max_length=50)),
                ("app_id", models.CharField(max_length=100)),
                ("client_secret", models.CharField(max_length=100)),
                (
                    "platform",
                    models.CharField(
                        choices=[("ios", "Ios"), ("android", "Android")], max_length=20
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "Facebook",
            },
        ),
        migrations.CreateModel(
            name="Google",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("game", models.CharField(max_length=50)),
                ("client_id", models.CharField(max_length=50)),
                ("project_id", models.CharField(max_length=50)),
                ("private_key_id", models.CharField(max_length=60)),
                ("type", models.CharField(default="service_account", max_length=20)),
                ("private_key", models.TextField()),
                ("client_email", models.EmailField(max_length=254)),
                ("auth_uri", models.URLField()),
                ("token_uri", models.URLField()),
                ("client_x509_cert_url", models.URLField()),
                ("auth_provider_x509_cert_url", models.URLField()),
            ],
            options={
                "verbose_name_plural": "Google",
            },
        ),
        migrations.CreateModel(
            name="Log",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("game", models.CharField(max_length=50, null=True)),
                ("version", models.CharField(max_length=10, null=True)),
                ("log_level", models.CharField(blank=True, max_length=15, null=True)),
                (
                    "platform",
                    models.CharField(
                        choices=[("ios", "Ios"), ("android", "Android")], max_length=20
                    ),
                ),
                ("message", models.TextField()),
                ("details", models.JSONField(blank=True, null=True)),
                ("time", models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name="Purchase",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("game", models.CharField(max_length=50)),
                ("currency", models.CharField(max_length=25)),
                ("log_time", models.CharField(max_length=11)),
                ("ext_info", models.CharField(max_length=255)),
                ("product_id", models.CharField(max_length=255)),
                ("transaction_id", models.CharField(max_length=255)),
                ("bundle_short_version", models.CharField(max_length=255)),
                ("fb_user_id", models.CharField(max_length=255, null=True)),
                ("advertiser_id", models.CharField(max_length=255, null=True)),
                (
                    "platform",
                    models.CharField(
                        choices=[("ios", "Ios"), ("android", "Android")], max_length=8
                    ),
                ),
                ("value_to_sum", models.FloatField()),
                ("body", models.JSONField()),
                ("is_valid", models.BooleanField(default=False)),
                ("is_sandbox", models.BooleanField(default=False)),
                ("fb_is_logged", models.BooleanField(default=False)),
                ("af_is_logged", models.BooleanField(default=False)),
                ("adjust_is_logged", models.BooleanField(default=False)),
            ],
        ),
        migrations.AddConstraint(
            model_name="google",
            constraint=models.UniqueConstraint(fields=("game",), name="unique"),
        ),
        migrations.AddField(
            model_name="adjustlog",
            name="purchase",
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="adjust_log",
                to="purchase.purchase",
            ),
        ),
    ]
