# Generated by Django 3.2.13 on 2022-05-05 22:24

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='DeviceFingerprint',
            fields=[
                ('oid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('browser', models.CharField(max_length=32)),
                ('browser_major_version', models.IntegerField()),
                ('device_category', models.CharField(max_length=32)),
                ('os', models.CharField(max_length=32)),
                ('platform', models.CharField(max_length=32)),
                ('screen_height', models.IntegerField()),
                ('screen_width', models.IntegerField()),
                ('user_agent', models.TextField()),
                ('viewport_height', models.IntegerField()),
                ('viewport_width', models.IntegerField()),
            ],
            options={
                'db_table': 'djspoofer_device_fingerprint',
            },
        ),
        migrations.CreateModel(
            name='Fingerprint',
            fields=[
                ('oid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'djspoofer_fingerprint',
                'ordering': ['-created'],
            },
        ),
        migrations.CreateModel(
            name='Geolocation',
            fields=[
                ('oid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('city', models.CharField(max_length=64)),
                ('country', models.CharField(max_length=2)),
                ('isp', models.CharField(blank=True, max_length=64, null=True)),
            ],
            options={
                'db_table': 'djspoofer_geolocation',
                'ordering': ['-created'],
            },
        ),
        migrations.CreateModel(
            name='H2Fingerprint',
            fields=[
                ('oid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('browser', models.CharField(max_length=32)),
                ('browser_min_major_version', models.IntegerField(default=0)),
                ('browser_max_major_version', models.IntegerField(default=999)),
                ('os', models.CharField(max_length=32)),
                ('header_table_size', models.IntegerField()),
                ('enable_push', models.BooleanField(blank=True, null=True)),
                ('max_concurrent_streams', models.IntegerField(blank=True, null=True)),
                ('initial_window_size', models.IntegerField()),
                ('max_frame_size', models.IntegerField(blank=True, null=True)),
                ('max_header_list_size', models.IntegerField(blank=True, null=True)),
                ('psuedo_header_order', models.TextField()),
                ('window_update_increment', models.IntegerField()),
                ('priority_stream_id', models.IntegerField()),
                ('priority_exclusive', models.BooleanField()),
                ('priority_depends_on_id', models.IntegerField()),
                ('priority_weight', models.IntegerField()),
            ],
            options={
                'db_table': 'djspoofer_h2_fingerprint',
                'ordering': ['-created'],
            },
        ),
        migrations.CreateModel(
            name='IntoliFingerprint',
            fields=[
                ('oid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('browser', models.CharField(max_length=32)),
                ('browser_major_version', models.IntegerField()),
                ('device_category', models.CharField(max_length=32)),
                ('os', models.CharField(max_length=32)),
                ('platform', models.CharField(max_length=32)),
                ('screen_height', models.IntegerField()),
                ('screen_width', models.IntegerField()),
                ('user_agent', models.TextField()),
                ('viewport_height', models.IntegerField()),
                ('viewport_width', models.IntegerField()),
                ('weight', models.DecimalField(decimal_places=24, max_digits=25)),
            ],
            options={
                'db_table': 'djspoofer_intoli_fingerprint',
                'ordering': ['-weight'],
            },
        ),
        migrations.CreateModel(
            name='IP',
            fields=[
                ('oid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('city', models.CharField(max_length=64)),
                ('country', models.CharField(max_length=2)),
                ('isp', models.CharField(max_length=64)),
                ('address', models.GenericIPAddressField()),
            ],
            options={
                'db_table': 'djspoofer_ip',
                'ordering': ['-created'],
            },
        ),
        migrations.CreateModel(
            name='Proxy',
            fields=[
                ('oid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('url', models.TextField(unique=True)),
                ('mode', models.IntegerField(choices=[(10, 'GENERAL'), (20, 'ROTATING'), (30, 'STICKY')], default=10)),
                ('country', models.CharField(blank=True, max_length=3, null=True)),
                ('city', models.CharField(blank=True, max_length=64, null=True)),
                ('last_used', models.DateTimeField(blank=True, null=True)),
                ('used_count', models.IntegerField(default=0)),
                ('cooldown', models.DurationField(default=datetime.timedelta(seconds=600))),
            ],
            options={
                'db_table': 'djspoofer_proxy',
                'ordering': ['url'],
            },
        ),
        migrations.CreateModel(
            name='TLSFingerprint',
            fields=[
                ('oid', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('browser', models.CharField(max_length=32)),
                ('browser_min_major_version', models.IntegerField(default=0)),
                ('browser_max_major_version', models.IntegerField(default=999)),
                ('os', models.CharField(max_length=32)),
                ('extensions', models.IntegerField()),
                ('ciphers', models.TextField()),
            ],
            options={
                'db_table': 'djspoofer_tls_fingerprint',
                'ordering': ['-created'],
            },
        ),
        migrations.AddIndex(
            model_name='tlsfingerprint',
            index=models.Index(fields=['browser'], name='tls_fp_browser'),
        ),
        migrations.AddIndex(
            model_name='ip',
            index=models.Index(fields=['city'], name='ip_fp_city'),
        ),
        migrations.AddIndex(
            model_name='ip',
            index=models.Index(fields=['country'], name='ip_fp_country'),
        ),
        migrations.AddIndex(
            model_name='ip',
            index=models.Index(fields=['isp'], name='ip_fp_isp'),
        ),
        migrations.AddIndex(
            model_name='intolifingerprint',
            index=models.Index(fields=['browser'], name='idx_intoli_fp_browser'),
        ),
        migrations.AddIndex(
            model_name='intolifingerprint',
            index=models.Index(fields=['device_category'], name='idx_intoli_fp_device_category'),
        ),
        migrations.AddIndex(
            model_name='intolifingerprint',
            index=models.Index(fields=['os'], name='idx_intoli_fp_os'),
        ),
        migrations.AddIndex(
            model_name='intolifingerprint',
            index=models.Index(fields=['platform'], name='idx_intoli_fp_platform'),
        ),
        migrations.AddField(
            model_name='fingerprint',
            name='_h2_fingerprint',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='fingerprints', to='djspoofer.h2fingerprint'),
        ),
        migrations.AddField(
            model_name='fingerprint',
            name='_tls_fingerprint',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='fingerprints', to='djspoofer.tlsfingerprint'),
        ),
        migrations.AddField(
            model_name='fingerprint',
            name='device_fingerprint',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='fingerprints', to='djspoofer.devicefingerprint'),
        ),
        migrations.AddField(
            model_name='fingerprint',
            name='geolocation',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='fingerprints', to='djspoofer.geolocation'),
        ),
        migrations.AddField(
            model_name='fingerprint',
            name='ip',
            field=models.ManyToManyField(to='djspoofer.IP'),
        ),
        migrations.AddIndex(
            model_name='devicefingerprint',
            index=models.Index(fields=['browser'], name='idx_device_fp_browser'),
        ),
        migrations.AddIndex(
            model_name='devicefingerprint',
            index=models.Index(fields=['device_category'], name='idx_device_fp_device_category'),
        ),
        migrations.AddIndex(
            model_name='devicefingerprint',
            index=models.Index(fields=['platform'], name='idx_device_fp_platform'),
        ),
    ]
