# Generated by Django 3.0.5 on 2020-06-23 11:43

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Motion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('index', models.IntegerField()),
            ],
            options={
                'ordering': ['index'],
            },
        ),
        migrations.CreateModel(
            name='Video',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32)),
                ('model', models.FileField(help_text='모델 파일 업로드', upload_to='media/model')),
                ('motion', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='video_set', to='log.Motion')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Log',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('count', models.IntegerField()),
                ('created_at', models.DateField(auto_now=True)),
                ('motion', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='log_set', to='log.Motion')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='log_set', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['created_at'],
            },
        ),
    ]
