From 0c1048ed89f1f7d46bbc48a3f9d39e6867ff2e5b Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 31 Jan 2023 10:42:55 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=20migrations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0093_auto_20220403_1627.py | 18 ++++++++++++------ apps/assets/migrations/0107_automation.py | 18 ++---------------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/apps/assets/migrations/0093_auto_20220403_1627.py b/apps/assets/migrations/0093_auto_20220403_1627.py index ee536497e..71d88f773 100644 --- a/apps/assets/migrations/0093_auto_20220403_1627.py +++ b/apps/assets/migrations/0093_auto_20220403_1627.py @@ -71,12 +71,18 @@ class Migration(migrations.Migration): ), migrations.AlterModelOptions( name='asset', - options={'ordering': ['name'], - 'permissions': [('refresh_assethardwareinfo', 'Can refresh asset hardware info'), - ('test_assetconnectivity', 'Can test asset connectivity'), - ('push_assetsystemuser', 'Can push system user to asset'), - ('match_asset', 'Can match asset'), ('add_assettonode', 'Add asset to node'), - ('move_assettonode', 'Move asset to node')], 'verbose_name': 'Asset'}, + options={ + 'ordering': ['name'], + 'permissions': [ + ('refresh_assethardwareinfo', 'Can refresh asset hardware info'), + ('test_assetconnectivity', 'Can test asset connectivity'), + ('push_assetaccount', 'Can push account to asset'), + ('test_account', 'Can verify account'), ('match_asset', 'Can match asset'), + ('add_assettonode', 'Add asset to node'), + ('move_assettonode', 'Move asset to node') + ], + 'verbose_name': 'Asset' + }, ), migrations.RenameField( model_name='asset', diff --git a/apps/assets/migrations/0107_automation.py b/apps/assets/migrations/0107_automation.py index 38bb777e4..56c2cf4eb 100644 --- a/apps/assets/migrations/0107_automation.py +++ b/apps/assets/migrations/0107_automation.py @@ -35,7 +35,7 @@ class Migration(migrations.Migration): ], options={ 'verbose_name': 'Automation task', - 'unique_together': {('org_id', 'name')}, + 'unique_together': {('org_id', 'name', 'type')}, }, ), migrations.CreateModel( @@ -93,18 +93,4 @@ class Migration(migrations.Migration): name='automation', field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='executions', to='assets.baseautomation', verbose_name='Automation task'), ), - migrations.AlterUniqueTogether( - name='baseautomation', - unique_together={('org_id', 'name', 'type')}, - ), - migrations.AlterModelOptions( - name='asset', - options={'ordering': ['name'], - 'permissions': [('refresh_assethardwareinfo', 'Can refresh asset hardware info'), - ('test_assetconnectivity', 'Can test asset connectivity'), - ('push_assetaccount', 'Can push account to asset'), - ('test_account', 'Can verify account'), ('match_asset', 'Can match asset'), - ('add_assettonode', 'Add asset to node'), - ('move_assettonode', 'Move asset to node')], 'verbose_name': 'Asset'}, - ), -] + ]