# Generated by Django 2.0 on 2017-12-20 05:58

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='Entry',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('http_referer', models.CharField(max_length=512, null=True, verbose_name='HTTP Referer')),
                ('http_user_agent', models.TextField(null=True, verbose_name='HTTP User Agent')),
                ('remote_addr', models.CharField(max_length=40, verbose_name='Remote Address')),
                ('request_method', models.CharField(max_length=8, verbose_name='Request Method')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
                ('description', models.CharField(blank=True, max_length=128, null=True, verbose_name='Description')),
                ('remote_addr_is_private', models.NullBooleanField()),
                ('is_secure', models.BooleanField(default=False, verbose_name='Is Secure')),
            ],
            options={
                'ordering': ('-created',),
                'verbose_name_plural': 'entries',
            },
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('country', models.CharField(blank=True, max_length=32, verbose_name='Country')),
                ('country_code', models.CharField(blank=True, max_length=2, verbose_name='Country Code')),
                ('region', models.CharField(blank=True, max_length=32, verbose_name='Region')),
                ('region_code', models.CharField(blank=True, max_length=8, verbose_name='Region Code')),
                ('city', models.CharField(blank=True, max_length=32, verbose_name='City')),
                ('zip_code', models.CharField(blank=True, max_length=8, verbose_name='Zip Code')),
                ('latitude', models.FloatField(default=0, verbose_name='Latitude')),
                ('longitude', models.FloatField(default=0, verbose_name='Longitude')),
                ('timezone', models.CharField(blank=True, max_length=32, verbose_name='Timezone')),
                ('isp', models.CharField(blank=True, max_length=32, verbose_name='ISP')),
                ('organization', models.CharField(blank=True, max_length=32, verbose_name='Organiztion')),
                ('as_name', models.CharField(blank=True, max_length=32, verbose_name='AS number/name')),
                ('created', models.DateTimeField(auto_now_add=True, verbose_name='Created')),
            ],
        ),
        migrations.CreateModel(
            name='Path',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.TextField(verbose_name='Name')),
            ],
        ),
        migrations.AddField(
            model_name='entry',
            name='location',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='activity_logger.Location', verbose_name='Location'),
        ),
        migrations.AddField(
            model_name='entry',
            name='path',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='activity_logger.Path', verbose_name='Path'),
        ),
        migrations.AddField(
            model_name='entry',
            name='user',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='User'),
        ),
    ]
