# Generated by Django 3.1.4 on 2021-03-09 08:45

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Family',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('family', models.CharField(max_length=255, unique=True, verbose_name='Семейство')),
            ],
            options={
                'db_table': 'family',
                'ordering': ['family'],
            },
        ),
        migrations.CreateModel(
            name='Genus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True, verbose_name='Родовое название')),
                ('family_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='genus_name', to='station.family', verbose_name='Семейство')),
            ],
            options={
                'db_table': 'genus',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Samples',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sample_num', models.PositiveIntegerField(default=1, verbose_name='Номер пробы')),
                ('subsample_num', models.PositiveIntegerField(default=1, verbose_name='Номер подпробы')),
                ('weight', models.FloatField(blank=True, default=0.0, null=True, verbose_name='Масса')),
            ],
            options={
                'db_table': 'samples',
                'ordering': ['sample_num', 'subsample_num'],
            },
        ),
        migrations.CreateModel(
            name='Ship',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Наименование')),
                ('eng_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='Английское наименование')),
                ('code', models.CharField(blank=True, max_length=100, null=True, verbose_name='Код')),
                ('descr', models.CharField(blank=True, max_length=2000, null=True, verbose_name='Описание')),
                ('descr_st', models.CharField(blank=True, max_length=100, null=True, verbose_name='Описание станций')),
                ('descr_worm', models.CharField(blank=True, max_length=100, null=True, verbose_name='Описание червей')),
            ],
            options={
                'db_table': 'ship',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Station',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('num', models.IntegerField(default=0, verbose_name='Номер станции')),
                ('cruise', models.CharField(default='0', max_length=255, verbose_name='Код рейса')),
                ('latitude', models.DecimalField(decimal_places=6, default=0.0, max_digits=9, verbose_name='Широта')),
                ('longitude', models.DecimalField(decimal_places=6, default=0.0, max_digits=9, verbose_name='Долгота')),
                ('ddate', models.DateTimeField(blank=True, null=True, verbose_name='Дата сбора')),
                ('rem', models.CharField(blank=True, max_length=2000, null=True, verbose_name='Примечание')),
                ('sample', models.ManyToManyField(related_name='station', to='station.Samples', verbose_name='Проба')),
                ('ship_code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='station.ship', verbose_name='Код судна')),
            ],
            options={
                'db_table': 'station',
                'ordering': ['num'],
            },
        ),
        migrations.CreateModel(
            name='Species',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Название')),
                ('species_name', models.CharField(blank=True, max_length=255, null=True, verbose_name='Видовое название')),
                ('author', models.CharField(blank=True, max_length=50, null=True, verbose_name='Автор')),
                ('remark', models.CharField(blank=True, max_length=150, null=True, verbose_name='Примечание')),
                ('family', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='station.family', verbose_name='Семейство')),
                ('genus_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='station.genus', verbose_name='Родовое название')),
            ],
            options={
                'db_table': 'species',
                'ordering': ['name'],
            },
        ),
        migrations.AddField(
            model_name='samples',
            name='species',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='station.species', verbose_name='Вид'),
        ),
    ]
