Skip to content

Commit

Permalink
minor: remove data source name global unique
Browse files Browse the repository at this point in the history
  • Loading branch information
narasux committed Nov 21, 2023
1 parent 67d9e64 commit 13cb15d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 3.2.20 on 2023-11-21 04:01

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('data_source', '0002_init_builtin_data_source_plugin'),
]

operations = [
migrations.AlterField(
model_name='datasource',
name='name',
field=models.CharField(max_length=128, verbose_name='数据源名称'),
),
migrations.AlterUniqueTogether(
name='datasource',
unique_together={('name', 'owner_tenant_id')},
),
]
3 changes: 2 additions & 1 deletion src/bk-user/bkuser/apps/data_source/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def create(self, *args, **kwargs):


class DataSource(AuditedModel):
name = models.CharField("数据源名称", max_length=128, unique=True)
name = models.CharField("数据源名称", max_length=128)
owner_tenant_id = models.CharField("归属租户", max_length=64, db_index=True)
status = models.CharField(
"数据源状态",
Expand All @@ -73,6 +73,7 @@ class DataSource(AuditedModel):

class Meta:
ordering = ["id"]
unique_together = [("name", "owner_tenant_id")]

@property
def is_local(self) -> bool:
Expand Down

0 comments on commit 13cb15d

Please sign in to comment.