Skip to content

Commit

Permalink
bugfix: 项目启动卡住的问题 (fixed #1743) (#1744)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuoZhuoCrayon authored Aug 17, 2023
1 parent 034d746 commit 6cc5c99
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 3 deletions.
44 changes: 44 additions & 0 deletions pipeline/component_framework/migrations/0007_auto_20230816_1537.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://opensource.org/licenses/MIT
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.
"""


from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("component_framework", "0006_auto_20200213_0743"),
]

operations = [
migrations.AlterField(
model_name="componentmodel",
name="code",
field=models.CharField(db_index=True, max_length=255, verbose_name="组件编码"),
),
migrations.AlterField(
model_name="componentmodel",
name="name",
field=models.CharField(db_index=True, max_length=255, verbose_name="组件名称"),
),
migrations.AlterField(
model_name="componentmodel",
name="version",
field=models.CharField(db_index=True, default="legacy", max_length=64, verbose_name="组件版本"),
),
migrations.AddIndex(
model_name="componentmodel",
index=models.Index(fields=["code", "version"], name="idx_code_version"),
),
]
10 changes: 7 additions & 3 deletions pipeline/component_framework/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ class ComponentModel(models.Model):
注册的组件
"""

code = models.CharField(_("组件编码"), max_length=255)
version = models.CharField(_("组件版本"), max_length=64, default=LEGACY_PLUGINS_VERSION)
name = models.CharField(_("组件名称"), max_length=255)
code = models.CharField(_("组件编码"), max_length=255, db_index=True)
version = models.CharField(_("组件版本"), max_length=64, default=LEGACY_PLUGINS_VERSION, db_index=True)
name = models.CharField(_("组件名称"), max_length=255, db_index=True)
status = models.BooleanField(_("组件是否可用"), default=True)

objects = ComponentManager()
Expand All @@ -51,6 +51,10 @@ class Meta:
verbose_name_plural = _("组件 Component")
ordering = ["-id"]

indexes = [
models.Index(fields=["code", "version"], name="idx_code_version"),
]

def __unicode__(self):
return self.name

Expand Down

0 comments on commit 6cc5c99

Please sign in to comment.