# Generated by Django 3.0.5 on 2022-10-12 06:04

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='DrfRequestLog',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('requested_at', models.DateTimeField(db_index=True)),
                ('response_ms', models.PositiveIntegerField(default=0)),
                ('path', models.CharField(db_index=True, help_text='请求地址', max_length=400)),
                ('view', models.CharField(blank=True, db_index=True, help_text='执行视图', max_length=400, null=True)),
                ('view_method', models.CharField(blank=True, db_index=True, max_length=20, null=True)),
                ('remote_addr', models.GenericIPAddressField()),
                ('host', models.URLField()),
                ('method', models.CharField(max_length=10)),
                ('query_params', models.TextField(blank=True, null=True)),
                ('data', models.TextField(blank=True, null=True)),
                ('response', models.TextField(blank=True, null=True)),
                ('errors', models.TextField(blank=True, null=True)),
                ('agent', models.TextField(blank=True, null=True)),
                ('status_code', models.PositiveIntegerField(blank=True, db_index=True, null=True)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'DRF请求日志',
            },
        ),
    ]
