# Generated by Django 3.0.1 on 2020-01-26 14:14

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Camera',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=64)),
                ('address', models.CharField(blank=True, default='', max_length=64, null=True)),
                ('port_number', models.CharField(default='-', max_length=4)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cameras', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Photo',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('uploaded', models.DateTimeField(auto_now_add=True, null=True)),
                ('photo', models.ImageField(blank=True, null=True, upload_to='photos/%Y/%m/%d')),
                ('take_new', models.BooleanField(default=True)),
                ('camera', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='photos', to='cameras.Camera')),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='my_photos', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['uploaded', 'camera'],
            },
        ),
    ]
