# Generated by Django 3.2.9 on 2021-12-02 23:36

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('img', models.ImageField(null=True, upload_to='images/', verbose_name='')),
            ],
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=200, unique=True)),
                ('given_name', models.CharField(max_length=200, unique=True)),
                ('images', models.ManyToManyField(blank=True, related_name='persons', to='database.Image')),
            ],
        ),
        migrations.CreateModel(
            name='Ship',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, unique=True)),
                ('images', models.ManyToManyField(blank=True, related_name='ships', to='database.Image')),
            ],
        ),
        migrations.CreateModel(
            name='Rescue',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField()),
                ('images', models.ManyToManyField(blank=True, related_name='rescues', to='database.Image')),
                ('lifeguard', models.ManyToManyField(blank=True, related_name='rescues', to='database.Person')),
                ('rescued', models.ManyToManyField(blank=True, related_name='distresses', to='database.Person')),
                ('rescued_ship', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='rescued_in', to='database.ship')),
                ('save_ship', models.ForeignKey(default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='savor', to='database.ship')),
            ],
        ),
    ]
