# Generated by Django 4.2.27 on 2026-01-28 19:34

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Aliment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nom', models.CharField(max_length=200)),
                ('categorie', models.CharField(choices=[('legume_vert', 'Légumes verts'), ('proteine', 'Protéines'), ('lipide', 'Lipides'), ('glucide', 'Glucides'), ('fruit', 'Fruits & Crudités')], max_length=20)),
                ('portion_standard', models.CharField(max_length=100)),
                ('notes', models.TextField(blank=True, null=True)),
            ],
            options={
                'ordering': ['categorie', 'nom'],
            },
        ),
        migrations.CreateModel(
            name='Journee',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('type_journee', models.CharField(choices=[('pauvre', 'Pauvre en glucides'), ('normal', 'Normal en glucides'), ('riche', 'Riche en glucides')], max_length=10)),
                ('notes', models.TextField(blank=True, null=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-date'],
                'unique_together': {('user', 'date')},
            },
        ),
        migrations.CreateModel(
            name='Repas',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type_repas', models.CharField(choices=[('petit_dejeuner', 'Petit-déjeuner'), ('dejeuner', 'Déjeuner'), ('collation', 'Collation'), ('diner', 'Dîner')], max_length=20)),
                ('heure', models.TimeField(blank=True, null=True)),
                ('notes', models.TextField(blank=True, null=True)),
                ('journee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='repas', to='nutrition.journee')),
            ],
            options={
                'ordering': ['heure'],
            },
        ),
        migrations.CreateModel(
            name='CompositionRepas',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nombre_portions', models.DecimalField(decimal_places=1, default=1.0, max_digits=4)),
                ('notes', models.CharField(blank=True, max_length=200)),
                ('aliment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='nutrition.aliment')),
                ('repas', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='compositions', to='nutrition.repas')),
            ],
        ),
    ]
