# Generated by Django 4.0.1 on 2023-03-29 20:39

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


class Migration(migrations.Migration):

    replaces = [('material', '0001_initial'), ('material', '0002_auto_20171011_2045')]

    dependencies = [
        ('members', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='MaterialPart',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30, verbose_name='name')),
                ('description', models.CharField(default='', max_length=140, verbose_name='description')),
                ('quantity', models.IntegerField(default=0, verbose_name='quantity')),
                ('buy_date', models.DateField(verbose_name='purchase date')),
                ('lifetime', models.DecimalField(decimal_places=0, max_digits=3, verbose_name='lifetime (years)')),
                ('photo', models.ImageField(blank=True, upload_to='images', verbose_name='photo')),
            ],
            options={
                'verbose_name': 'material part',
                'verbose_name_plural': 'material parts',
            },
        ),
        migrations.CreateModel(
            name='Ownership',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('count', models.IntegerField(default=1, verbose_name='count')),
                ('material', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='material.materialpart')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='members.member', verbose_name='owner')),
            ],
            options={
                'verbose_name': 'ownership',
                'verbose_name_plural': 'ownerships',
            },
        ),
        migrations.CreateModel(
            name='MaterialCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=40, verbose_name='Name')),
            ],
            options={
                'verbose_name': 'Material category',
                'verbose_name_plural': 'Material categories',
            },
        ),
        migrations.AddField(
            model_name='materialpart',
            name='material_cat',
            field=models.ManyToManyField(default=None, to='material.MaterialCategory', verbose_name='Material category'),
        ),
    ]
