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

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('igny8_core_auth', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='SystemSettings',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(db_index=True, help_text='Settings key identifier', max_length=255, unique=True)),
                ('value', models.JSONField(default=dict, help_text='Settings value as JSON')),
                ('description', models.TextField(blank=True, help_text='Description of this setting')),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'db_table': 'igny8_system_settings',
                'ordering': ['key'],
                'indexes': [models.Index(fields=['key'], name='igny8_syste_key_20500b_idx')],
            },
        ),
        migrations.CreateModel(
            name='AccountSettings',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('config', models.JSONField(default=dict, help_text='Settings configuration as JSON')),
                ('is_active', models.BooleanField(default=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('key', models.CharField(db_index=True, help_text='Settings key identifier', max_length=255)),
                ('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={
                'db_table': 'igny8_account_settings',
                'ordering': ['key'],
                'indexes': [models.Index(fields=['account', 'key'], name='igny8_accou_tenant__308b8f_idx')],
                'unique_together': {('account', 'key')},
            },
        ),
        migrations.CreateModel(
            name='AIPrompt',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('prompt_type', models.CharField(choices=[('clustering', 'Clustering'), ('ideas', 'Ideas Generation'), ('content_generation', 'Content Generation'), ('image_prompt_extraction', 'Image Prompt Extraction'), ('image_prompt_template', 'Image Prompt Template'), ('negative_prompt', 'Negative Prompt'), ('site_structure_generation', 'Site Structure Generation'), ('product_generation', 'Product Content Generation'), ('service_generation', 'Service Page Generation'), ('taxonomy_generation', 'Taxonomy Generation')], db_index=True, max_length=50)),
                ('prompt_value', models.TextField(help_text='The prompt template text')),
                ('default_prompt', models.TextField(help_text='Default prompt value (for reset)')),
                ('is_active', models.BooleanField(default=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_at', models.DateTimeField(auto_now_add=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={
                'db_table': 'igny8_ai_prompts',
                'ordering': ['prompt_type'],
                'indexes': [models.Index(fields=['prompt_type'], name='igny8_ai_pr_prompt__4b2dbe_idx'), models.Index(fields=['account', 'prompt_type'], name='igny8_ai_pr_tenant__9e7b95_idx')],
                'unique_together': {('account', 'prompt_type')},
            },
        ),
        migrations.CreateModel(
            name='AISettings',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('integration_type', models.CharField(db_index=True, help_text="Integration type (e.g., 'openai', 'runware')", max_length=50)),
                ('config', models.JSONField(default=dict, help_text='Integration configuration (API keys, settings, etc.)')),
                ('model_preferences', models.JSONField(default=dict, help_text='Model preferences per operation type')),
                ('cost_limits', models.JSONField(default=dict, help_text='Cost limits and budgets')),
                ('is_active', models.BooleanField(default=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_at', models.DateTimeField(auto_now_add=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={
                'db_table': 'igny8_ai_settings',
                'ordering': ['integration_type'],
                'indexes': [models.Index(fields=['integration_type'], name='igny8_ai_se_integra_4f0b21_idx'), models.Index(fields=['account', 'integration_type'], name='igny8_ai_se_tenant__05ae98_idx')],
                'unique_together': {('account', 'integration_type')},
            },
        ),
        migrations.CreateModel(
            name='AuthorProfile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text="Profile name (e.g., 'SaaS B2B Informative')", max_length=255)),
                ('description', models.TextField(blank=True, help_text='Description of the writing style')),
                ('tone', models.CharField(help_text="Writing tone (e.g., 'Professional', 'Casual', 'Technical', 'Conversational')", max_length=100)),
                ('language', models.CharField(default='en', help_text="Language code (e.g., 'en', 'es', 'fr')", max_length=50)),
                ('structure_template', models.JSONField(default=dict, help_text='Structure template defining content sections and their order')),
                ('is_active', models.BooleanField(db_index=True, default=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_at', models.DateTimeField(auto_now_add=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': 'Author Profile',
                'verbose_name_plural': 'Author Profiles',
                'db_table': 'igny8_author_profiles',
                'ordering': ['name'],
                'indexes': [models.Index(fields=['account', 'is_active'], name='igny8_autho_tenant__97d2c2_idx'), models.Index(fields=['name'], name='igny8_autho_name_8295f3_idx')],
            },
        ),
        migrations.CreateModel(
            name='IntegrationSettings',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('integration_type', models.CharField(choices=[('openai', 'OpenAI'), ('runware', 'Runware'), ('gsc', 'Google Search Console'), ('image_generation', 'Image Generation Service')], db_index=True, max_length=50)),
                ('config', models.JSONField(default=dict, help_text='Integration configuration (API keys, settings, etc.)')),
                ('is_active', models.BooleanField(default=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_at', models.DateTimeField(auto_now_add=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={
                'db_table': 'igny8_integration_settings',
                'ordering': ['integration_type'],
                'indexes': [models.Index(fields=['integration_type'], name='igny8_integ_integra_5e382e_idx'), models.Index(fields=['account', 'integration_type'], name='igny8_integ_tenant__5da472_idx')],
                'unique_together': {('account', 'integration_type')},
            },
        ),
        migrations.CreateModel(
            name='ModuleEnableSettings',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('planner_enabled', models.BooleanField(default=True, help_text='Enable Planner module')),
                ('writer_enabled', models.BooleanField(default=True, help_text='Enable Writer module')),
                ('thinker_enabled', models.BooleanField(default=True, help_text='Enable Thinker module')),
                ('automation_enabled', models.BooleanField(default=True, help_text='Enable Automation module')),
                ('site_builder_enabled', models.BooleanField(default=True, help_text='Enable Site Builder module')),
                ('linker_enabled', models.BooleanField(default=True, help_text='Enable Linker module')),
                ('optimizer_enabled', models.BooleanField(default=True, help_text='Enable Optimizer module')),
                ('publisher_enabled', models.BooleanField(default=True, help_text='Enable Publisher module')),
                ('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={
                'db_table': 'igny8_module_enable_settings',
                'unique_together': {('account',)},
            },
        ),
        migrations.CreateModel(
            name='ModuleSettings',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('config', models.JSONField(default=dict, help_text='Settings configuration as JSON')),
                ('is_active', models.BooleanField(default=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('module_name', models.CharField(db_index=True, help_text="Module name (e.g., 'planner', 'writer')", max_length=100)),
                ('key', models.CharField(db_index=True, help_text='Settings key identifier', max_length=255)),
                ('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={
                'db_table': 'igny8_module_settings',
                'ordering': ['module_name', 'key'],
                'indexes': [models.Index(fields=['account', 'module_name', 'key'], name='igny8_modul_tenant__21ee25_idx'), models.Index(fields=['module_name', 'key'], name='igny8_modul_module__95373a_idx')],
                'unique_together': {('account', 'module_name', 'key')},
            },
        ),
        migrations.CreateModel(
            name='Strategy',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='Strategy name', max_length=255)),
                ('description', models.TextField(blank=True, help_text='Description of the content strategy')),
                ('prompt_types', models.JSONField(default=list, help_text="List of prompt types to use (e.g., ['clustering', 'ideas', 'content_generation'])")),
                ('section_logic', models.JSONField(default=dict, help_text='Section logic configuration defining content structure and flow')),
                ('is_active', models.BooleanField(db_index=True, default=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_at', models.DateTimeField(auto_now_add=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')),
                ('sector', models.ForeignKey(blank=True, help_text='Optional: Link strategy to a specific sector', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='strategies', to='igny8_core_auth.sector')),
            ],
            options={
                'verbose_name': 'Strategy',
                'verbose_name_plural': 'Strategies',
                'db_table': 'igny8_strategies',
                'ordering': ['name'],
                'indexes': [models.Index(fields=['account', 'is_active'], name='igny8_strat_tenant__344de9_idx'), models.Index(fields=['account', 'sector'], name='igny8_strat_tenant__279cfa_idx'), models.Index(fields=['name'], name='igny8_strat_name_8fe823_idx')],
            },
        ),
        migrations.CreateModel(
            name='UserSettings',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(db_index=True, help_text='Settings key identifier', max_length=255)),
                ('value', models.JSONField(default=dict, help_text='Settings value as JSON')),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('account', models.ForeignKey(db_column='tenant_id', on_delete=django.db.models.deletion.CASCADE, related_name='user_settings', to='igny8_core_auth.account')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_settings', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'igny8_user_settings',
                'ordering': ['key'],
                'indexes': [models.Index(fields=['user', 'account', 'key'], name='igny8_user__user_id_ac09d9_idx'), models.Index(fields=['account', 'key'], name='igny8_user__tenant__01033d_idx')],
                'unique_together': {('user', 'account', 'key')},
            },
        ),
    ]
