# Generated by Django 3.2.15 on 2022-09-12 14:00

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_lifecycle.mixins
import uuid


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('core', '0092_alter_upload_options'),
        ('ansible', '0044_alter_collectionremote_token'),
    ]

    operations = [
        migrations.CreateModel(
            name='DownloadLog',
            fields=[
                ('pulp_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('pulp_created', models.DateTimeField(auto_now_add=True)),
                ('pulp_last_updated', models.DateTimeField(auto_now=True, null=True)),
                ('ip', models.GenericIPAddressField()),
                ('extra_data', models.JSONField(null=True)),
                ('user_agent', models.TextField()),
                ('content_unit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='download_logs', to='core.content')),
                ('repository', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='download_logs', to='core.repository')),
                ('repository_version', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='download_logs', to='core.repositoryversion')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='download_logs', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
            bases=(django_lifecycle.mixins.LifecycleModelMixin, models.Model),
        ),
    ]
