# Generated by Django 3.1.4 on 2022-11-16 10:57

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


class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('company', '0305_companycfg_product_batchlot'),
    ]

    operations = [
        migrations.CreateModel(
            name='OperationLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.IntegerField(blank=True, null=True, verbose_name='实例ID')),
                ('tb_name', models.CharField(blank=True, max_length=50, null=True, verbose_name='自建表名称')),
                ('action', models.SmallIntegerField(choices=[(1, '修改'), (2, '删除')], verbose_name='操作类型')),
                ('changes', models.JSONField(default=list, verbose_name='修改内容')),
                ('dt', models.DateField(auto_now_add=True, db_index=True, verbose_name='日期')),
                ('tm', models.DateTimeField(auto_now_add=True, verbose_name='时间')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='operationlog_company', to='company.company', verbose_name='所属企业')),
                ('contenttype', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='operationlog_contenttype', to='contenttypes.contenttype', verbose_name='对像/表名')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='operationlog_user', to=settings.AUTH_USER_MODEL, verbose_name='操作人')),
            ],
            options={
                'verbose_name': '修改删除操作日志',
                'verbose_name_plural': '修改删除操作日志',
            },
        ),
    ]
