# Generated by Django 3.2.18 on 2023-10-16 07:12

from django.db import migrations, models


class Migration(migrations.Migration):
    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="RollbackNodeSnapshot",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("root_pipeline_id", models.CharField(db_index=True, max_length=64, verbose_name="root pipeline id")),
                ("node_id", models.CharField(db_index=True, max_length=64, verbose_name="node_id")),
                ("code", models.CharField(max_length=64, verbose_name="node_code")),
                ("version", models.CharField(max_length=33, verbose_name="version")),
                ("inputs", models.TextField(verbose_name="node inputs")),
                ("outputs", models.TextField(verbose_name="node outputs")),
                ("context_values", models.TextField(verbose_name="pipeline context values")),
                ("rolled_back", models.BooleanField(default=False, verbose_name="whether the node rolls back")),
            ],
        ),
        migrations.CreateModel(
            name="RollbackPlan",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("root_pipeline_id", models.CharField(db_index=True, max_length=64, verbose_name="root pipeline id")),
                ("start_node_id", models.CharField(db_index=True, max_length=64, verbose_name="start node id")),
                ("target_node_id", models.CharField(db_index=True, max_length=64, verbose_name="target_node_id")),
                ("mode", models.CharField(default="TOKEN", max_length=32, verbose_name="rollback mode")),
                ("is_expired", models.BooleanField(default=False, verbose_name="is expired")),
            ],
        ),
        migrations.CreateModel(
            name="RollbackSnapshot",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("root_pipeline_id", models.CharField(db_index=True, max_length=64, verbose_name="root pipeline id")),
                ("graph", models.TextField(verbose_name="rollback graph")),
                ("node_access_record", models.TextField(verbose_name="node access record")),
                ("skip_rollback_nodes", models.TextField(verbose_name="skip rollback nodes")),
                ("other_nodes", models.TextField(verbose_name="other nodes")),
                ("start_node_id", models.CharField(db_index=True, max_length=64, verbose_name="start node id")),
                ("target_node_id", models.CharField(db_index=True, max_length=64, verbose_name="target_node_id")),
                ("is_expired", models.BooleanField(db_index=True, default=False, verbose_name="is expired")),
            ],
        ),
        migrations.CreateModel(
            name="RollbackToken",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("root_pipeline_id", models.CharField(db_index=True, max_length=64, verbose_name="root pipeline id")),
                ("token", models.TextField(verbose_name="token map")),
                (
                    "is_deleted",
                    models.BooleanField(
                        db_index=True, default=False, help_text="is deleted", verbose_name="is deleted"
                    ),
                ),
            ],
        ),
    ]
