# Generated by Django 3.1.1 on 2020-11-28 05:10

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("contenttypes", "0002_remove_content_type_name"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Trace",
            fields=[
                ("id", models.BigAutoField(primary_key=True, serialize=False)),
                (
                    "action",
                    models.PositiveSmallIntegerField(
                        choices=[(1, "Crear"), (2, "Editar"), (3, "Eliminar")],
                        verbose_name="acción",
                    ),
                ),
                ("message", models.TextField(verbose_name="mensaje")),
                (
                    "object_id",
                    models.PositiveIntegerField(verbose_name="id del objecto"),
                ),
                ("date", models.DateTimeField(auto_now_add=True, verbose_name="fecha")),
                (
                    "content_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.contenttype",
                        verbose_name="contenido",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.PROTECT,
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="usuario",
                    ),
                ),
            ],
            options={
                "verbose_name": "Rastro",
            },
        ),
        migrations.CreateModel(
            name="Rule",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created_date",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="fecha de creación"
                    ),
                ),
                (
                    "created_user",
                    models.CharField(
                        editable=False,
                        max_length=128,
                        null=True,
                        verbose_name="creado por",
                    ),
                ),
                (
                    "modified_date",
                    models.DateTimeField(
                        auto_now=True, verbose_name="última fecha de modificación"
                    ),
                ),
                (
                    "modified_user",
                    models.CharField(
                        editable=False,
                        max_length=128,
                        null=True,
                        verbose_name="modificado por",
                    ),
                ),
                ("is_active", models.BooleanField(default=True, verbose_name="activo")),
                (
                    "check_create",
                    models.BooleanField(verbose_name="rastrear creaciones"),
                ),
                (
                    "check_edit",
                    models.BooleanField(verbose_name="rastrear modificaciones"),
                ),
                (
                    "check_delete",
                    models.BooleanField(verbose_name="rastrear eliminaciones"),
                ),
                (
                    "content_type",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.contenttype",
                        verbose_name="Objeto",
                    ),
                ),
            ],
            options={
                "verbose_name": "Regla",
            },
        ),
    ]
