# Generated by Django 3.2 on 2021-04-07 17:24

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name="UserActivityHistory",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("timestamp", models.DateTimeField(auto_now_add=True)),
                ("last_updated", models.DateTimeField(auto_now=True)),
                ("request_path", models.TextField(null=True)),
                ("request_method", models.TextField(null=True)),
                (
                    "request_scheme",
                    models.CharField(blank=True, max_length=10240, null=True),
                ),
                ("request_remote_addr", models.TextField(null=True)),
                ("request_user_agent", models.TextField(null=True)),
                ("request_origin", models.TextField(null=True)),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="activity_history",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "User Activity History",
                "verbose_name_plural": "User Activity Histories",
                "db_table": "user_activity_history",
                "ordering": ["-id"],
            },
        ),
        migrations.CreateModel(
            name="ActiveUserLog",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("timestamp", models.DateTimeField(auto_now_add=True)),
                ("last_updated", models.DateTimeField(auto_now=True)),
                ("time", models.DateTimeField()),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="activity_log",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Active User",
                "verbose_name_plural": "Active users",
                "db_table": "active_user_log",
                "ordering": ["-id"],
            },
        ),
    ]
