Skip to content

Commit 36a7bd7

Browse files
committed
feat: add workspace_id field to ToolRecord and task record models
1 parent 1f4ecf4 commit 36a7bd7

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

apps/tools/migrations/0005_taskrecord.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class Migration(migrations.Migration):
2525
('state', models.CharField(choices=[('PENDING', 'Pending'), ('STARTED', 'Started'), ('SUCCESS', 'Success'), ('FAILURE', 'Failure'), ('REVOKE', 'Revoke'), ('REVOKED', 'Revoked')], default='STARTED', max_length=20, verbose_name='状态')),
2626
('run_time', models.FloatField(default=0, verbose_name='运行时长')),
2727
('tool', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='tools.tool')),
28+
('workspace_id', models.CharField(db_index=True, default='default', max_length=64, verbose_name='工作空间id')),
2829
],
2930
options={
3031
'db_table': 'tool_record',

apps/tools/models/tool.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ class Meta:
7272
class ToolRecord(AppModelMixin):
7373
id = models.UUIDField(primary_key=True, max_length=128, default=uuid.uuid7, editable=False, verbose_name="主键id")
7474
tool = models.ForeignKey(Tool, on_delete=models.SET_NULL, null=True)
75+
workspace_id = models.CharField(max_length=64, verbose_name="工作空间id", default="default", db_index=True)
7576
source_type = models.CharField(verbose_name="触发器任务类型", choices=ToolTaskTypeChoices.choices,
7677
default=ToolTaskTypeChoices.APPLICATION, max_length=256)
7778
source_id = models.UUIDField(verbose_name="资源id")

0 commit comments

Comments
 (0)