# Generated by Django 5.1 on 2026-05-02 17:34

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.AddField(
            model_name='article',
            name='author',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='Auteur'),
        ),
        migrations.AddField(
            model_name='articletranslation',
            name='article',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='Blog.article'),
        ),
        migrations.AddField(
            model_name='article',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='articles', to='Blog.category', verbose_name='Catégorie'),
        ),
        migrations.AddField(
            model_name='categorytranslation',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='translations', to='Blog.category'),
        ),
        migrations.AddConstraint(
            model_name='articletranslation',
            constraint=models.UniqueConstraint(fields=('article', 'language'), name='unique_article_translation'),
        ),
        migrations.AddConstraint(
            model_name='categorytranslation',
            constraint=models.UniqueConstraint(fields=('category', 'language'), name='unique_category_translation'),
        ),
    ]
