# Generated by Django 2.1.4 on 2019-01-03 11:39

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='AllVisitor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('session_key', models.CharField(max_length=40)),
                ('ip_address', models.CharField(max_length=20)),
                ('user_agent', models.CharField(max_length=255)),
                ('referrer', models.CharField(max_length=255)),
                ('url', models.CharField(max_length=255)),
                ('page_views', models.PositiveIntegerField(default=0)),
                ('country', django_countries.fields.CountryField(default='', max_length=2, verbose_name='country')),
                ('session_start', models.DateTimeField()),
                ('last_update', models.DateTimeField()),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-last_update',),
            },
        ),
        migrations.CreateModel(
            name='ReferrerCompany',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('companyname', models.TextField(default='', verbose_name='companyname')),
                ('totalview', models.PositiveIntegerField(default=0)),
                ('created', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='ReferrerCountry',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('country', django_countries.fields.CountryField(default='', max_length=2, verbose_name='country')),
                ('totalview', models.PositiveIntegerField(default=0)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('referrercompany', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='referrercountrys', to='tracking.ReferrerCompany')),
            ],
        ),
        migrations.CreateModel(
            name='Visitor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('session_key', models.CharField(max_length=40)),
                ('ip_address', models.CharField(max_length=20)),
                ('user_agent', models.CharField(max_length=255)),
                ('referrer', models.CharField(max_length=255)),
                ('url', models.CharField(max_length=255)),
                ('page_views', models.PositiveIntegerField(default=0)),
                ('country', django_countries.fields.CountryField(default='', max_length=2, verbose_name='country')),
                ('session_start', models.DateTimeField()),
                ('last_update', models.DateTimeField()),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-last_update',),
            },
        ),
    ]
