# Generated by Django 5.0.1 on 2024-01-27 20:59

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


class Migration(migrations.Migration):

    dependencies = [
        ('django_navbar', '0003_alter_navigation_url'),
    ]

    operations = [
        migrations.CreateModel(
            name='NavigationDropDown',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='', max_length=50)),
                ('url', models.CharField(default='', max_length=50)),
                ('type', models.CharField(choices=[('nav-item', 'Nav Item'), ('nav-item dropdown', 'Nav Item Drop'), ('dropdown-item', 'Drop Down Item')], default='nav-item', max_length=50)),
                ('order', models.IntegerField(default=0)),
            ],
        ),
        migrations.RemoveConstraint(
            model_name='navigation',
            name='order must be uniqe',
        ),
        migrations.AlterField(
            model_name='navigation',
            name='type',
            field=models.CharField(choices=[('nav-item', 'Nav Item'), ('nav-item dropdown', 'Nav Item Drop'), ('dropdown-item', 'Drop Down Item')], default='nav-item', max_length=50),
        ),
        migrations.AddConstraint(
            model_name='navigation',
            constraint=models.UniqueConstraint(fields=('order',), name='navigation_order_unique'),
        ),
        migrations.AddField(
            model_name='navigationdropdown',
            name='parent',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='DropDownRelation', to='navigation.navigation'),
        ),
        migrations.AddConstraint(
            model_name='navigationdropdown',
            constraint=models.UniqueConstraint(fields=('parent', 'order'), name='dropdown_order_unique'),
        ),
    ]
