# Generated by Django 2.1.1 on 2018-11-13 17:59

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Act',
            fields=[
                ('act_number', models.AutoField(primary_key=True, serialize=False, verbose_name='Номер акта')),
                ('start_date', models.DateField(default=django.utils.timezone.now, verbose_name='Дата заключения')),
                ('stop_date', models.DateField(verbose_name='Дата истечения')),
                ('timestamp', models.DateField(auto_now_add=True)),
                ('updated', models.DateField(auto_now=True)),
                ('term', models.DurationField(blank=True, editable=False, null=True)),
                ('term_left', models.DurationField(blank=True, editable=False, null=True)),
                ('payment', models.FloatField(max_length=45, verbose_name='Оплата')),
                ('all_payment', models.FloatField(blank=True, default=None, max_length=45, null=True)),
                ('is_active', models.BooleanField(default=True, editable=False)),
            ],
            options={
                'db_table': 'act',
            },
        ),
        migrations.CreateModel(
            name='Cash',
            fields=[
                ('id_cash', models.AutoField(primary_key=True, serialize=False)),
                ('cash_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Дата продажи')),
                ('sell', models.IntegerField(default=0, verbose_name='Продано')),
                ('all_cash', models.FloatField(default=0, max_length=45, verbose_name='Сумма продажи')),
                ('discount', models.FloatField(default=0, max_length=45, verbose_name='Скидка')),
                ('nal', models.BooleanField(default=True)),
            ],
            options={
                'db_table': 'cash',
            },
        ),
        migrations.CreateModel(
            name='Orders',
            fields=[
                ('orders_id', models.AutoField(primary_key=True, serialize=False)),
                ('name_item', models.CharField(max_length=45, verbose_name='Наименование')),
                ('description_item', models.CharField(blank=True, max_length=100, null=True, verbose_name='Описание')),
                ('materials', models.CharField(blank=True, max_length=45, null=True, verbose_name='Материалы')),
                ('quality', models.IntegerField(default=0, verbose_name='Количество')),
                ('all_sell', models.IntegerField(default=0, verbose_name='Всего продано')),
                ('all_take', models.IntegerField(default=0, verbose_name='Всего забрал арендатор')),
                ('price', models.FloatField(default=0, max_length=45, verbose_name='Цена')),
                ('is_active', models.BooleanField(default=True)),
                ('act', models.ForeignKey(db_column='act', on_delete=django.db.models.deletion.DO_NOTHING, to='tenants_app.Act', verbose_name='Номер акта')),
            ],
            options={
                'verbose_name': 'Order',
                'verbose_name_plural': 'Orders',
                'db_table': 'orders',
            },
        ),
        migrations.CreateModel(
            name='Rents',
            fields=[
                ('rents_id', models.AutoField(primary_key=True, serialize=False)),
                ('number', models.CharField(blank=True, max_length=45, null=True, unique=True, verbose_name='Номер договора')),
                ('start_date', models.DateField(default=django.utils.timezone.now, verbose_name='Дата заключения')),
                ('stop_date', models.DateField(blank=True, null=True, verbose_name='Дата истечения')),
                ('updated', models.DateField(auto_now=True)),
                ('term_left', models.DurationField(blank=True, editable=False, null=True)),
                ('is_active', models.BooleanField(default=True, editable=False)),
                ('is_break', models.BooleanField(default=False, editable=False)),
                ('tenants', models.ForeignKey(db_column='tenant', on_delete=django.db.models.deletion.DO_NOTHING, related_name='tenant', to=settings.AUTH_USER_MODEL, verbose_name='Арендатор')),
            ],
            options={
                'verbose_name': 'Rent',
                'verbose_name_plural': 'Rents',
                'db_table': 'rents',
            },
        ),
        migrations.CreateModel(
            name='Shelf',
            fields=[
                ('shelf_id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=45, unique=True)),
                ('price', models.IntegerField(blank=True, null=True)),
            ],
            options={
                'db_table': 'shelf',
            },
        ),
        migrations.AddField(
            model_name='cash',
            name='orders',
            field=models.ForeignKey(db_column='orders', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='tenants_app.Orders', verbose_name='Наименование товара'),
        ),
        migrations.AddField(
            model_name='act',
            name='rents',
            field=models.ForeignKey(db_column='rents', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='tenants_app.Rents', verbose_name='Договор'),
        ),
        migrations.AddField(
            model_name='act',
            name='shelf',
            field=models.OneToOneField(db_column='shelf', null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='tenants_app.Shelf', verbose_name='Полка'),
        ),
    ]
