# Generated migration for Industry and IndustrySector models

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


class Migration(migrations.Migration):

    dependencies = [
        ('igny8_core_auth', '0003_alter_user_role'),
    ]

    operations = [
        migrations.CreateModel(
            name='Industry',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
                ('slug', models.SlugField(db_index=True, max_length=255, unique=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('is_active', models.BooleanField(db_index=True, default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'igny8_industries',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='IndustrySector',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('slug', models.SlugField(db_index=True, max_length=255)),
                ('description', models.TextField(blank=True, null=True)),
                ('suggested_keywords', models.JSONField(default=list, help_text='List of suggested keywords for this sector template')),
                ('is_active', models.BooleanField(db_index=True, default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('industry', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sectors', to='igny8_core_auth.industry')),
            ],
            options={
                'db_table': 'igny8_industry_sectors',
                'ordering': ['industry', 'name'],
                'unique_together': {('industry', 'slug')},
            },
        ),
        migrations.AddField(
            model_name='sector',
            name='industry_sector',
            field=models.ForeignKey(blank=True, help_text='Reference to the industry sector template', null=True, on_delete=django.db.models.deletion.PROTECT, related_name='site_sectors', to='igny8_core_auth.industrysector'),
        ),
        migrations.AddIndex(
            model_name='industry',
            index=models.Index(fields=['slug'], name='igny8_indu_slug_idx'),
        ),
        migrations.AddIndex(
            model_name='industry',
            index=models.Index(fields=['is_active'], name='igny8_indu_is_acti_idx'),
        ),
        migrations.AddIndex(
            model_name='industrysector',
            index=models.Index(fields=['industry', 'is_active'], name='igny8_indu_industr_idx'),
        ),
        migrations.AddIndex(
            model_name='industrysector',
            index=models.Index(fields=['slug'], name='igny8_indu_slug_1_idx'),
        ),
        migrations.AddIndex(
            model_name='sector',
            index=models.Index(fields=['industry_sector'], name='igny8_sect_industr_idx'),
        ),
    ]

