# Generated by Django 5.2.7 on 2025-10-20 17:31

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


class Migration(migrations.Migration):

    dependencies = [
        ('accrete', '0010_alter_accessgroup_description'),
        ('log', '0007_alter_log_new_value_type_alter_log_old_value_type'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Activity',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(blank=True, default='', verbose_name='Code')),
                ('description', accrete.fields.TranslatedCharField(blank=True, null=True, verbose_name='Description')),
                ('model', models.CharField(blank=True, help_text='Combination of app label and model name seperated by a dot', max_length=255, null=True, verbose_name='Model')),
                ('object_id', models.BigIntegerField(blank=True, null=True, verbose_name='Object ID')),
                ('log_date', models.DateTimeField(auto_now_add=True, verbose_name='Date')),
                ('tenant', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='accrete_activities', to='accrete.tenant', verbose_name='Tenant')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='accrete_activities', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Activity',
                'verbose_name_plural': 'Activities',
                'db_table': 'accrete_activity',
            },
        ),
        migrations.AddField(
            model_name='log',
            name='activity',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='logs', to='log.activity'),
        ),
    ]
