Skip to content

Commit

Permalink
bugfix: 项目启动卡住的问题 (fixed #1743)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuoZhuoCrayon committed Aug 16, 2023
1 parent cca52bf commit e239411
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
32 changes: 32 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,32 @@
# Generated by Django 3.2.4 on 2023-08-16 07:37

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 e239411

Please sign in to comment.