# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-LOG 蓝鲸日志平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company.  All rights reserved.
BK-LOG 蓝鲸日志平台 is licensed under the MIT License.
License for BK-LOG 蓝鲸日志平台:
--------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
We undertake not to change the open source license (MIT license) applicable to the current version of
the project delivered to anyone in the future.
"""
# Generated by Django 1.11.23 on 2020-06-19 14:49
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Strategies",
            fields=[
                ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
                ("created_at", models.DateTimeField(auto_now_add=True, verbose_name="创建时间")),
                ("created_by", models.CharField(default="", max_length=32, verbose_name="创建者")),
                ("updated_at", models.DateTimeField(auto_now=True, null=True, verbose_name="更新时间")),
                ("updated_by", models.CharField(blank=True, default="", max_length=32, verbose_name="修改者")),
                ("bk_biz_id", models.IntegerField(db_index=True, verbose_name="业务ID")),
                ("strategy_name", models.TextField(verbose_name="策略名称")),
                ("user_list", apps.models.MultiStrSplitByCommaFieldText(max_length=128, verbose_name="用户组ID")),
                ("select_type", models.CharField(max_length=128, verbose_name="目标选择类型")),
                ("modules", apps.models.JsonField(max_length=128, verbose_name="模块列表")),
                ("visible_dir", apps.models.MultiStrSplitByCommaFieldText(max_length=128, verbose_name="目录列表")),
                ("file_type", apps.models.MultiStrSplitByCommaFieldText(max_length=128, verbose_name="文件类型")),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="Tasks",
            fields=[
                ("created_at", models.DateTimeField(auto_now_add=True, verbose_name="创建时间")),
                ("created_by", models.CharField(default="", max_length=32, verbose_name="创建者")),
                ("updated_at", models.DateTimeField(auto_now=True, null=True, verbose_name="更新时间")),
                ("updated_by", models.CharField(blank=True, default="", max_length=32, verbose_name="修改者")),
                ("task_id", models.AutoField(primary_key=True, serialize=False, verbose_name="任务记录id")),
                ("bk_biz_id", models.IntegerField(verbose_name="业务id")),
                ("ip_list", apps.models.MultiStrSplitByCommaFieldText(verbose_name="业务机器ip")),
                ("file_path", apps.models.MultiStrSplitByCommaFieldText(verbose_name="文件列表")),
                (
                    "filter_type",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("match_word", "按关键字过滤行"),
                            ("line_range", "按行数过滤"),
                            ("tail_line", "获取最新n行"),
                            ("match_range", "按关键字范围过滤行"),
                        ],
                        max_length=16,
                        null=True,
                        verbose_name="过滤类型",
                    ),
                ),
                ("filter_content", apps.models.JsonField(blank=True, null=True, verbose_name="过滤内容")),
                (
                    "download_status",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("packing", "打包中"),
                            ("distributing", "分发中"),
                            ("uploading", "上传中"),
                            ("downloadable", "可下载"),
                            ("redownloadable", "重新下载"),
                            ("expired", "已过期"),
                        ],
                        max_length=16,
                        null=True,
                        verbose_name="当前文件下载状态",
                    ),
                ),
                ("pipeline_id", models.CharField(blank=True, max_length=128, null=True, verbose_name="流水线ID")),
                ("job_task_id", models.IntegerField(blank=True, null=True, verbose_name="文件分发ID")),
                ("cstone_upload_ticket", models.IntegerField(blank=True, null=True, verbose_name="上传票据")),
                ("cstone_upload_random", models.TextField(blank=True, null=True, verbose_name="上传随机值")),
                ("job_upload_task_id", models.IntegerField(blank=True, null=True, verbose_name="任务上传ID")),
                ("cstone_upload_task_id", models.IntegerField(blank=True, null=True, verbose_name="云石上传ID")),
                ("cstone_download_task_id", models.IntegerField(blank=True, null=True, verbose_name="云石任务ID")),
                ("cstone_download_ticket", models.IntegerField(blank=True, null=True, verbose_name="下载票据")),
                ("cstone_download_random", models.TextField(blank=True, null=True, verbose_name="下载随机值")),
            ],
            options={
                "abstract": False,
            },
        ),
    ]
