# Generated by Django 5.2.8 on 2025-11-07 10:06

import django.core.validators
import django.db.models.deletion
import django.utils.timezone
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('igny8_core_auth', '0008_passwordresettoken_alter_industry_options_and_more'),
        ('writer', '0002_rename_taskimages_add_content_and_keywords'),
    ]

    operations = [
        migrations.AlterModelOptions(
            name='content',
            options={'ordering': ['-generated_at'], 'verbose_name': 'Content', 'verbose_name_plural': 'Contents'},
        ),
        migrations.AlterModelOptions(
            name='images',
            options={'ordering': ['task', 'position', '-created_at'], 'verbose_name': 'Image', 'verbose_name_plural': 'Images'},
        ),
        migrations.AlterModelOptions(
            name='tasks',
            options={'ordering': ['-created_at'], 'verbose_name': 'Task', 'verbose_name_plural': 'Tasks'},
        ),
        migrations.RenameIndex(
            model_name='content',
            new_name='igny8_conte_task_id_712988_idx',
            old_name='igny8_content_task_id_idx',
        ),
        migrations.RenameIndex(
            model_name='content',
            new_name='igny8_conte_generat_7128df_idx',
            old_name='igny8_content_generated_idx',
        ),
        migrations.RenameIndex(
            model_name='images',
            new_name='igny8_image_task_id_c80e87_idx',
            old_name='igny8_task__task_id_143db4_idx',
        ),
        migrations.RenameIndex(
            model_name='images',
            new_name='igny8_image_status_4a4de2_idx',
            old_name='igny8_task__status_4f869f_idx',
        ),
        migrations.RenameIndex(
            model_name='images',
            new_name='igny8_image_task_id_6340e6_idx',
            old_name='igny8_images_task_id_pos_idx',
        ),
        migrations.AddField(
            model_name='content',
            name='created_at',
            field=models.DateTimeField(auto_now_add=True, db_index=True, default=django.utils.timezone.now),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='content',
            name='sector',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.sector'),
        ),
        migrations.AlterField(
            model_name='content',
            name='site',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.site'),
        ),
        migrations.AlterField(
            model_name='content',
            name='tenant',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.tenant'),
        ),
        migrations.AlterField(
            model_name='content',
            name='word_count',
            field=models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0)]),
        ),
        migrations.AlterField(
            model_name='images',
            name='image_path',
            field=models.CharField(blank=True, help_text='Local path if stored locally', max_length=500, null=True),
        ),
        migrations.AlterField(
            model_name='images',
            name='image_url',
            field=models.URLField(blank=True, help_text='URL of the generated/stored image', null=True),
        ),
        migrations.AlterField(
            model_name='images',
            name='position',
            field=models.IntegerField(default=0, help_text='Position for in-article images ordering'),
        ),
        migrations.AlterField(
            model_name='images',
            name='prompt',
            field=models.TextField(blank=True, help_text='Image generation prompt used', null=True),
        ),
        migrations.AlterField(
            model_name='images',
            name='status',
            field=models.CharField(default='pending', help_text='Status: pending, generated, failed', max_length=50),
        ),
        migrations.AlterField(
            model_name='images',
            name='task',
            field=models.ForeignKey(help_text='The task this image belongs to', on_delete=django.db.models.deletion.CASCADE, related_name='images', to='writer.tasks'),
        ),
    ]
