# Generated by Django 2.1.9 on 2019-11-26 14:31

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('interactive', '0014_merge_20191201_1159'),
    ]

    operations = [
        migrations.CreateModel(
            name='PlaceAction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time', models.DateTimeField()),
                ('x', models.PositiveIntegerField()),
                ('y', models.PositiveIntegerField()),
                ('color', models.CharField(max_length=6)),
            ],
        ),
        migrations.CreateModel(
            name='PlaceGrid',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('width', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1)], verbose_name='Bredde')),
                ('height', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1)], verbose_name='Høyde')),
                ('cooldown', models.PositiveIntegerField(verbose_name='Cooldown (s)')),
                ('enabled', models.BooleanField(default=True)),
                ('publish_date', models.DateTimeField(verbose_name='Slippdato')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('last_updated', models.DateTimeField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='PlaceLine',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('y', models.PositiveIntegerField()),
                ('last_updated', models.DateTimeField()),
                ('grid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lines', to='interactive.PlaceGrid')),
            ],
        ),
        migrations.CreateModel(
            name='PlacePixel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('x', models.PositiveIntegerField()),
                ('color', models.CharField(max_length=6, verbose_name='Color')),
                ('last_updated', models.DateTimeField()),
                ('latest_action', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pixel', to='interactive.PlaceAction')),
                ('line', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pixels', to='interactive.PlaceLine')),
            ],
        ),
        migrations.AddField(
            model_name='placeaction',
            name='grid',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='actions', to='interactive.PlaceGrid'),
        ),
        migrations.AddField(
            model_name='placeaction',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='actions', to=settings.AUTH_USER_MODEL),
        ),
    ]
