# Generated by Django 5.1.2 on 2024-10-30 00:09

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Bom',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=255)),
                ('code', models.CharField(max_length=255)),
                ('product_qty', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Obj',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cmp_id', models.IntegerField()),
                ('code', models.CharField(max_length=255)),
                ('name', models.CharField(max_length=255)),
                ('cmp_qty', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('code', models.CharField(max_length=255)),
                ('name', models.CharField(max_length=255)),
                ('stock', models.FloatField(default=0)),
                ('stock_prv', models.FloatField(default=0)),
                ('stock_min', models.FloatField(default=0)),
                ('flag', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Produit',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nom', models.CharField(max_length=255)),
                ('description', models.TextField()),
                ('prix', models.FloatField()),
                ('image', models.ImageField(upload_to='images/')),
            ],
        ),
        migrations.CreateModel(
            name='Book',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='books', to='produits.author')),
            ],
        ),
        migrations.CreateModel(
            name='Bom_lines',
            fields=[
                ('id', models.IntegerField(primary_key=True, serialize=False)),
                ('product_qty', models.IntegerField()),
                ('bom_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bom_lines', to='produits.bom')),
                ('product_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='product_id', to='produits.product')),
            ],
        ),
        migrations.AddField(
            model_name='bom',
            name='product_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='boms', to='produits.product'),
        ),
    ]
