# Generated by Django 5.2.8 on 2025-11-25 15:59

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


class Migration(migrations.Migration):

    dependencies = [
        ('igny8_core_auth', '0002_add_wp_api_key_to_site'),
        ('planner', '0004_remove_clusters_igny8_clust_context_0d6bd7_idx_and_more'),
        ('writer', '0006_cleanup_migrate_and_drop_deprecated_fields'),
    ]

    operations = [
        migrations.AlterUniqueTogether(
            name='contenttaxonomyrelation',
            unique_together=None,
        ),
        migrations.RemoveField(
            model_name='contenttaxonomyrelation',
            name='content',
        ),
        migrations.RemoveField(
            model_name='contenttaxonomyrelation',
            name='taxonomy',
        ),
        migrations.RemoveField(
            model_name='content',
            name='taxonomies',
        ),
        migrations.AlterModelOptions(
            name='content',
            options={'ordering': ['-created_at'], 'verbose_name': 'Content', 'verbose_name_plural': 'Contents'},
        ),
        migrations.RemoveIndex(
            model_name='content',
            name='igny8_conte_task_id_712988_idx',
        ),
        migrations.RemoveIndex(
            model_name='content',
            name='igny8_conte_generat_7128df_idx',
        ),
        migrations.RemoveIndex(
            model_name='content',
            name='igny8_conte_sync_st_02d5bd_idx',
        ),
        migrations.RemoveIndex(
            model_name='content',
            name='igny8_conte_source_df78d0_idx',
        ),
        migrations.RemoveIndex(
            model_name='content',
            name='igny8_conte_entity__f559b3_idx',
        ),
        migrations.RemoveIndex(
            model_name='content',
            name='igny8_conte_content_b538ee_idx',
        ),
        migrations.RemoveIndex(
            model_name='content',
            name='igny8_conte_cluster_32e22a_idx',
        ),
        migrations.RemoveIndex(
            model_name='content',
            name='igny8_conte_externa_a26125_idx',
        ),
        migrations.RemoveIndex(
            model_name='content',
            name='igny8_conte_site_id_e559d5_idx',
        ),
        migrations.RemoveIndex(
            model_name='contenttaxonomy',
            name='igny8_conte_sync_st_307b43_idx',
        ),
        migrations.RemoveIndex(
            model_name='tasks',
            name='igny8_tasks_entity__1dc185_idx',
        ),
        migrations.RemoveIndex(
            model_name='tasks',
            name='igny8_tasks_cluster_c87903_idx',
        ),
        migrations.RemoveField(
            model_name='content',
            name='cluster_role',
        ),
        migrations.RemoveField(
            model_name='content',
            name='content_format',
        ),
        migrations.RemoveField(
            model_name='content',
            name='entity_type',
        ),
        migrations.RemoveField(
            model_name='content',
            name='external_type',
        ),
        migrations.RemoveField(
            model_name='content',
            name='generated_at',
        ),
        migrations.RemoveField(
            model_name='content',
            name='html_content',
        ),
        migrations.RemoveField(
            model_name='content',
            name='internal_links',
        ),
        migrations.RemoveField(
            model_name='content',
            name='json_blocks',
        ),
        migrations.RemoveField(
            model_name='content',
            name='linker_version',
        ),
        migrations.RemoveField(
            model_name='content',
            name='meta_description',
        ),
        migrations.RemoveField(
            model_name='content',
            name='meta_title',
        ),
        migrations.RemoveField(
            model_name='content',
            name='metadata',
        ),
        migrations.RemoveField(
            model_name='content',
            name='optimization_scores',
        ),
        migrations.RemoveField(
            model_name='content',
            name='optimizer_version',
        ),
        migrations.RemoveField(
            model_name='content',
            name='primary_keyword',
        ),
        migrations.RemoveField(
            model_name='content',
            name='secondary_keywords',
        ),
        migrations.RemoveField(
            model_name='content',
            name='structure_data',
        ),
        migrations.RemoveField(
            model_name='content',
            name='sync_metadata',
        ),
        migrations.RemoveField(
            model_name='content',
            name='sync_status',
        ),
        migrations.RemoveField(
            model_name='content',
            name='task',
        ),
        migrations.RemoveField(
            model_name='content',
            name='word_count',
        ),
        migrations.RemoveField(
            model_name='contenttaxonomy',
            name='clusters',
        ),
        migrations.RemoveField(
            model_name='contenttaxonomy',
            name='count',
        ),
        migrations.RemoveField(
            model_name='contenttaxonomy',
            name='description',
        ),
        migrations.RemoveField(
            model_name='contenttaxonomy',
            name='metadata',
        ),
        migrations.RemoveField(
            model_name='contenttaxonomy',
            name='parent',
        ),
        migrations.RemoveField(
            model_name='contenttaxonomy',
            name='sync_status',
        ),
        migrations.RemoveField(
            model_name='tasks',
            name='cluster_role',
        ),
        migrations.RemoveField(
            model_name='tasks',
            name='entity_type',
        ),
        migrations.RemoveField(
            model_name='tasks',
            name='idea',
        ),
        migrations.RemoveField(
            model_name='tasks',
            name='keyword_objects',
        ),
        migrations.RemoveField(
            model_name='tasks',
            name='taxonomy',
        ),
        migrations.AddField(
            model_name='content',
            name='content_html',
            field=models.TextField(default='', help_text='Final HTML content'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='content',
            name='content_structure',
            field=models.CharField(db_index=True, default='post', help_text='Content structure/format: article, listicle, guide, comparison, product_page, etc.', max_length=100),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='content',
            name='content_type',
            field=models.CharField(db_index=True, default='article', help_text='Content type: post, page, product, service, category, tag, etc.', max_length=100),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='content',
            name='taxonomy_terms',
            field=models.ManyToManyField(blank=True, db_table='igny8_content_taxonomy_relations', help_text='Associated taxonomy terms (categories, tags, attributes)', related_name='contents', to='writer.contenttaxonomy'),
        ),
        migrations.AddField(
            model_name='tasks',
            name='content_structure',
            field=models.CharField(db_index=True, default='', help_text='Content structure/format: article, listicle, guide, comparison, product_page, etc.', max_length=100),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='tasks',
            name='content_type',
            field=models.CharField(db_index=True, default='post', help_text='Content type: post, page, product, service, category, tag, etc.', max_length=100),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='tasks',
            name='taxonomy_term',
            field=models.ForeignKey(blank=True, help_text='Optional taxonomy term assignment', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='tasks', to='writer.contenttaxonomy'),
        ),
        migrations.AlterField(
            model_name='content',
            name='cluster',
            field=models.ForeignKey(help_text='Parent cluster (required)', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='contents', to='planner.clusters'),
        ),
        migrations.AlterField(
            model_name='content',
            name='created_at',
            field=models.DateTimeField(auto_now_add=True),
        ),
        migrations.AlterField(
            model_name='content',
            name='external_id',
            field=models.CharField(blank=True, db_index=True, help_text='WordPress/external platform post ID', max_length=255, null=True),
        ),
        migrations.AlterField(
            model_name='content',
            name='external_url',
            field=models.URLField(blank=True, help_text='WordPress/external platform URL', null=True),
        ),
        migrations.AlterField(
            model_name='content',
            name='source',
            field=models.CharField(choices=[('igny8', 'IGNY8 Generated'), ('wordpress', 'WordPress Imported')], db_index=True, default='igny8', help_text='Content source', max_length=50),
        ),
        migrations.AlterField(
            model_name='content',
            name='status',
            field=models.CharField(choices=[('draft', 'Draft'), ('published', 'Published')], db_index=True, default='draft', help_text='Content status', max_length=50),
        ),
        migrations.AlterField(
            model_name='content',
            name='title',
            field=models.CharField(db_index=True, default='article', max_length=255),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='contenttaxonomy',
            name='external_id',
            field=models.IntegerField(blank=True, db_index=True, help_text='WordPress term_id - null for cluster taxonomies', null=True),
        ),
        migrations.AlterField(
            model_name='contenttaxonomy',
            name='external_taxonomy',
            field=models.CharField(blank=True, help_text='WordPress taxonomy slug (category, post_tag, product_cat, pa_*) - null for cluster taxonomies', max_length=100, null=True),
        ),
        migrations.AlterField(
            model_name='contenttaxonomy',
            name='taxonomy_type',
            field=models.CharField(choices=[('category', 'Category'), ('tag', 'Tag'), ('product_category', 'Product Category'), ('product_attribute', 'Product Attribute'), ('cluster', 'Cluster Taxonomy')], db_index=True, help_text='Type of taxonomy', max_length=50),
        ),
        migrations.AlterField(
            model_name='tasks',
            name='cluster',
            field=models.ForeignKey(help_text='Parent cluster (required)', limit_choices_to={'sector': models.F('sector')}, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='tasks', to='planner.clusters'),
        ),
        migrations.RemoveField(
            model_name='tasks',
            name='keywords',
        ),
        migrations.AddIndex(
            model_name='content',
            index=models.Index(fields=['title'], name='igny8_conte_title_f13d63_idx'),
        ),
        migrations.AddIndex(
            model_name='content',
            index=models.Index(fields=['content_type'], name='igny8_conte_content_df9458_idx'),
        ),
        migrations.AddIndex(
            model_name='content',
            index=models.Index(fields=['content_structure'], name='igny8_conte_content_55cffb_idx'),
        ),
        migrations.AddIndex(
            model_name='content',
            index=models.Index(fields=['status'], name='igny8_conte_status_b7cba0_idx'),
        ),
        migrations.AddIndex(
            model_name='content',
            index=models.Index(fields=['external_id'], name='igny8_conte_externa_7ffbdf_idx'),
        ),
        migrations.AddIndex(
            model_name='content',
            index=models.Index(fields=['site', 'sector'], name='igny8_conte_site_id_dc7938_idx'),
        ),
        migrations.AddIndex(
            model_name='tasks',
            index=models.Index(fields=['content_structure'], name='igny8_tasks_content_733577_idx'),
        ),
        migrations.DeleteModel(
            name='ContentTaxonomyRelation',
        ),
        migrations.AddField(
            model_name='tasks',
            name='keywords',
            field=models.ManyToManyField(blank=True, help_text='Keywords linked to this task', related_name='tasks', to='planner.keywords'),
        ),
    ]
