# Generated by Django 6.0.4 on 2026-06-20 08:44

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


class Migration(migrations.Migration):

    dependencies = [
        ('projects', '0010_projectresource_lit_type_projectresource_publisher_and_more'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='ProjectLog',
            fields=[
                ('id', models.UUIDField(default=apps.projects.models.uuid7, editable=False, primary_key=True, serialize=False)),
                ('log_type', models.CharField(choices=[('project', 'Project'), ('task', 'Task'), ('document', 'Document'), ('finance', 'Finance'), ('fund', 'Fund'), ('team', 'Team'), ('dissemination', 'Dissemination'), ('schedule', 'Schedule'), ('resource', 'Resource'), ('status', 'Status')], default='project', max_length=20)),
                ('action', models.CharField(max_length=255)),
                ('detail', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('actor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='project_logs', to=settings.AUTH_USER_MODEL)),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='logs', to='projects.project')),
            ],
            options={
                'db_table': 'project_logs',
                'ordering': ['-created_at'],
                'indexes': [models.Index(fields=['project', '-created_at'], name='project_log_project_4d751f_idx')],
            },
        ),
    ]
