# Generated by Django 3.2.13 on 2022-09-21 07:25

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


class Migration(migrations.Migration):
    dependencies = [
        ("core", "0033_alter_userprofile_language"),
    ]

    operations = [
        migrations.AddField(
            model_name="application",
            name="installed_from_template",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="intalled_applications",
                to="core.template",
            ),
        ),
        migrations.CreateModel(
            name="InstallTemplateJob",
            fields=[
                (
                    "job_ptr",
                    models.OneToOneField(
                        auto_created=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        parent_link=True,
                        primary_key=True,
                        serialize=False,
                        to="core.job",
                    ),
                ),
                (
                    "user_websocket_id",
                    models.CharField(
                        help_text="The user websocket uuid needed to manage signals sent correctly.",
                        max_length=36,
                        null=True,
                    ),
                ),
                (
                    "user_session_id",
                    models.CharField(
                        help_text="The user session uuid needed for undo/redo functionality.",
                        max_length=36,
                        null=True,
                    ),
                ),
                (
                    "user_action_group_id",
                    models.CharField(
                        help_text="The user session uuid needed for undo/redo action group functionality.",
                        max_length=36,
                        null=True,
                    ),
                ),
                ("installed_applications", models.JSONField(default=list)),
                (
                    "group",
                    models.ForeignKey(
                        help_text="The group where the template is installed.",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="core.group",
                    ),
                ),
                (
                    "template",
                    models.ForeignKey(
                        help_text="The template that is installed.",
                        on_delete=django.db.models.deletion.CASCADE,
                        to="core.template",
                    ),
                ),
            ],
            options={
                "abstract": False,
            },
            bases=("core.job", models.Model),
        ),
    ]
