# Generated by Django 5.2.11 on 2026-03-10 10:46

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


class Migration(migrations.Migration):

    dependencies = [
        ('tools', '0006_alter_tool_tool_type'),
    ]

    operations = [
        migrations.AlterField(
            model_name='tool',
            name='tool_type',
            field=models.CharField(choices=[('INTERNAL', '内置'), ('CUSTOM', '自定义'), ('SKILL', '技能'), ('MCP', 'MCP工具'), ('DATA_SOURCE', '数据源'), ('WORKFLOW', 'Workflow')], db_index=True, default='CUSTOM', max_length=20, verbose_name='工具类型'),
        ),
        migrations.CreateModel(
            name='ToolWorkflow',
            fields=[
                ('create_time', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, db_index=True, verbose_name='修改时间')),
                ('id', models.UUIDField(default=uuid_utils.compat.uuid7, editable=False, primary_key=True, serialize=False, verbose_name='主键id')),
                ('workspace_id', models.CharField(db_index=True, default='default', max_length=64, verbose_name='工作空间id')),
                ('work_flow', models.JSONField(default=dict, verbose_name='工作流数据')),
                ('is_publish', models.BooleanField(db_index=True, default=False, verbose_name='是否发布')),
                ('publish_time', models.DateTimeField(blank=True, null=True, verbose_name='发布时间')),
                ('tool', models.OneToOneField(db_constraint=False, on_delete=django.db.models.deletion.CASCADE, related_name='workflow', to='tools.tool', verbose_name='工具')),
            ],
            options={
                'db_table': 'tool_workflow',
            },
        ),
        migrations.CreateModel(
            name='ToolWorkflowVersion',
            fields=[
                ('create_time', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, db_index=True, verbose_name='修改时间')),
                ('id', models.UUIDField(default=uuid_utils.compat.uuid7, editable=False, primary_key=True, serialize=False, verbose_name='主键id')),
                ('workspace_id', models.CharField(db_index=True, default='default', max_length=64, verbose_name='工作空间id')),
                ('name', models.CharField(default='', max_length=128, verbose_name='版本名称')),
                ('work_flow', models.JSONField(default=dict, verbose_name='工作流数据')),
                ('publish_user_id', models.UUIDField(default=None, null=True, verbose_name='发布者id')),
                ('publish_user_name', models.CharField(default='', max_length=128, verbose_name='发布者名称')),
                ('tool', models.ForeignKey(db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to='tools.tool', verbose_name='工具')),
            ],
            options={
                'db_table': 'tool_workflow_version',
            },
        ),
    ]
