# Generated by Django 5.1.5 on 2025-01-30 19:15

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


class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('core', '0084_add_aggregated_availability_permissions'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.RemoveField(
            model_name='dashboardwidget',
            name='active',
        ),
        migrations.RemoveField(
            model_name='dashboardwidget',
            name='broken',
        ),
        migrations.RemoveField(
            model_name='dashboardwidget',
            name='size_l',
        ),
        migrations.RemoveField(
            model_name='dashboardwidget',
            name='size_m',
        ),
        migrations.RemoveField(
            model_name='dashboardwidget',
            name='size_s',
        ),
        migrations.RemoveField(
            model_name='dashboardwidget',
            name='size_xl',
        ),
        migrations.AddField(
            model_name='dashboardwidget',
            name='status',
            field=models.CharField(choices=[('off', 'Off'), ('ready', 'Ready'), ('broken', 'Broken'), ('on', 'On')], default='off', max_length=10, verbose_name='Status'),
        ),
        migrations.CreateModel(
            name='DashboardWidgetConfiguration',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('managed_by_app_label', models.CharField(blank=True, editable=False, max_length=255, verbose_name='App label of app responsible for managing this instance')),
                ('extended_data', models.JSONField(default=dict, editable=False)),
                ('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_%(app_label)s.%(class)s_set+', to='contenttypes.contenttype')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
        ),
        migrations.CreateModel(
            name='DashboardWidgetInstance',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('managed_by_app_label', models.CharField(blank=True, editable=False, max_length=255, verbose_name='App label of app responsible for managing this instance')),
                ('extended_data', models.JSONField(default=dict, editable=False)),
                ('x', models.PositiveSmallIntegerField(validators=[django.core.validators.MaxValueValidator(11)], verbose_name='X position')),
                ('y', models.PositiveSmallIntegerField(verbose_name='X position')),
                ('width', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(12)], verbose_name='Width')),
                ('height', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1)], verbose_name='Height')),
                ('configuration', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.dashboardwidgetconfiguration', verbose_name='Configuration')),
                ('person', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.person', verbose_name='Person')),
                ('widget', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.dashboardwidget', verbose_name='Dashboard widget')),
            ],
            options={
                'verbose_name': 'Dashboard widget order',
                'verbose_name_plural': 'Dashboard widget orders',
            },
        ),
        migrations.DeleteModel(
            name='DashboardWidgetOrder',
        ),
    ]
