Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: 项目启动卡住的问题 (fixed #1743) #1744

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading