# Generated by Django 5.2.14 on 2026-08-19 19:10

import apps.base.utils.documents
import apps.base.utils.images
import django.db.models.deletion
import simple_history.models
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('is_deleted', models.BooleanField(default=False, verbose_name='Eliminado')),
                ('created_at', models.DateField(auto_now_add=True, verbose_name='Fecha de Creación')),
                ('updated_at', models.DateField(auto_now=True, verbose_name='Fecha de Modificación')),
                ('deleted_at', models.DateField(blank=True, null=True, verbose_name='Fecha de Eliminación')),
                ('project_name', models.CharField(max_length=255, verbose_name='Nombre del Proyecto')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Descripción')),
                ('project_document', models.FileField(blank=True, help_text='Archivo del proyecto (usualmente formato PDF)', null=True, upload_to=apps.base.utils.documents.rename_document_upload_to, verbose_name='Documento del Proyecto (PDF)')),
                ('project_images', models.ImageField(blank=True, help_text='Imagen representativa del proyecto', null=True, upload_to=apps.base.utils.images.rename_image_upload_to, verbose_name='Imágenes del Proyecto')),
            ],
            options={
                'verbose_name': 'Proyecto',
                'verbose_name_plural': 'Proyectos',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='HistoricalProject',
            fields=[
                ('id', models.IntegerField(blank=True, db_index=True)),
                ('is_deleted', models.BooleanField(default=False, verbose_name='Eliminado')),
                ('created_at', models.DateField(blank=True, editable=False, verbose_name='Fecha de Creación')),
                ('updated_at', models.DateField(blank=True, editable=False, verbose_name='Fecha de Modificación')),
                ('deleted_at', models.DateField(blank=True, null=True, verbose_name='Fecha de Eliminación')),
                ('project_name', models.CharField(max_length=255, verbose_name='Nombre del Proyecto')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Descripción')),
                ('project_document', models.TextField(blank=True, help_text='Archivo del proyecto (usualmente formato PDF)', max_length=100, null=True, verbose_name='Documento del Proyecto (PDF)')),
                ('project_images', models.TextField(blank=True, help_text='Imagen representativa del proyecto', max_length=100, null=True, verbose_name='Imágenes del Proyecto')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField(db_index=True)),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical Proyecto',
                'verbose_name_plural': 'historical Proyectos',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': ('history_date', 'history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
