# Generated by Django 3.2.23 on 2026-01-12 21:07

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('pages', '0002_create_default_pages'),
    ]

    operations = [
        migrations.CreateModel(
            name='Menu',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100, verbose_name='Nom du menu')),
                ('slug', models.SlugField(help_text='Identifiant unique pour le code (ex: main_navbar)', unique=True)),
            ],
            options={
                'verbose_name': 'Menu',
                'verbose_name_plural': 'Menus',
            },
        ),
        migrations.CreateModel(
            name='MenuItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100, verbose_name='Libellé')),
                ('external_url', models.CharField(blank=True, help_text="Utilisé seulement si aucune page interne n'est sélectionnée.", max_length=255, verbose_name='URL Externe / Manuelle')),
                ('order', models.PositiveIntegerField(default=0, verbose_name='Ordre')),
                ('menu', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='navigation.menu')),
                ('page', models.ForeignKey(blank=True, help_text="Si sélectionné, l'URL sera générée automatiquement.", null=True, on_delete=django.db.models.deletion.SET_NULL, to='pages.page', verbose_name='Page Interne')),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='navigation.menuitem', verbose_name='Parent (Sous-menu)')),
            ],
            options={
                'verbose_name': 'Élément de menu',
                'verbose_name_plural': 'Éléments de menu',
                'ordering': ['order'],
            },
        ),
    ]
