# Generated by Django 5.2.8 on 2025-11-20 23:27

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('igny8_core_auth', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='OptimizationTask',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('scores_before', models.JSONField(default=dict, help_text='Optimization scores before')),
                ('scores_after', models.JSONField(default=dict, help_text='Optimization scores after')),
                ('html_before', models.TextField(blank=True, help_text='HTML content before optimization')),
                ('html_after', models.TextField(blank=True, help_text='HTML content after optimization')),
                ('status', models.CharField(choices=[('pending', 'Pending'), ('running', 'Running'), ('completed', 'Completed'), ('failed', 'Failed')], db_index=True, default='pending', help_text='Optimization task status', max_length=20)),
                ('credits_used', models.IntegerField(default=0, help_text='Credits used for optimization', validators=[django.core.validators.MinValueValidator(0)])),
                ('metadata', models.JSONField(blank=True, default=dict, help_text='Additional metadata')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='%(class)s_set', to='igny8_core_auth.account')),
            ],
            options={
                'verbose_name': 'Optimization Task',
                'verbose_name_plural': 'Optimization Tasks',
                'db_table': 'igny8_optimization_tasks',
                'ordering': ['-created_at'],
            },
        ),
    ]
