# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-12-10 16:11
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="DevicesEvents",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("box_id", models.CharField(max_length=256)),
                ("device_power", models.IntegerField()),
                ("time_seen", models.DateTimeField()),
                ("access_point_id", models.CharField(max_length=100)),
                ("total_packets", models.IntegerField()),
                ("packets_captured", models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name="SeenByDay",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("box_id", models.CharField(max_length=256, unique_for_date="day")),
                ("day_start", models.DateTimeField()),
                ("seen", models.IntegerField()),
                ("seen_also_on_preceding_day", models.IntegerField()),
                ("seen_also_a_week_earlier", models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name="SeenByHour",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("box_id", models.CharField(max_length=256)),
                ("hour_start", models.DateTimeField()),
                ("seen", models.IntegerField()),
                ("seen_also_in_preceding_hour", models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name="TmuxStatus",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("box_id", models.CharField(max_length=256)),
                ("airodump_ng", models.BooleanField()),
                ("time_stamp", models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name="UniqueDevices",
            fields=[
                (
                    "device_id",
                    models.CharField(
                        db_index=True,
                        max_length=100,
                        primary_key=True,
                        serialize=False,
                        unique=True,
                    ),
                ),
                ("time_last_seen", models.DateTimeField()),
            ],
        ),
        migrations.AlterUniqueTogether(
            name="seenbyhour", unique_together=set([("box_id", "hour_start")])
        ),
        migrations.AddField(
            model_name="devicesevents",
            name="device",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to="data.UniqueDevices"
            ),
        ),
        migrations.AlterUniqueTogether(
            name="devicesevents", unique_together=set([("device", "time_seen")])
        ),
    ]
