Skip to content

Commit 4d45f4e

Browse files
committed
refactor: clean up Setting model and update migration dependencies
Signed-off-by: Michal Fiedorowicz <mfiedorowicz@netboxlabs.com>
1 parent 8fd5604 commit 4d45f4e

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env python
2+
# Copyright 2025 NetBox Labs, Inc.
3+
"""Diode NetBox Plugin - Database migrations."""
4+
5+
from django.db import migrations, models
6+
7+
8+
class Migration(migrations.Migration):
9+
"""Clean up Setting model by removing unused fields."""
10+
11+
dependencies = [
12+
("netbox_diode_plugin", "0006_clientcredentials_alter_setting_diode_target"),
13+
]
14+
15+
operations = [
16+
migrations.RemoveField(
17+
model_name="setting",
18+
name="custom_field_data",
19+
),
20+
migrations.RemoveField(
21+
model_name='setting',
22+
name='created',
23+
),
24+
migrations.RemoveField(
25+
model_name='setting',
26+
name='last_updated',
27+
),
28+
]

netbox_diode_plugin/migrations/0007_setting_branch.py renamed to netbox_diode_plugin/migrations/0008_setting_branch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
# Copyright 2025 NetBox Labs, Inc.
3-
"""Add branch_id field to Setting model."""
3+
"""Diode NetBox Plugin - Database migrations."""
44

55
from django.db import migrations, models
66

@@ -9,7 +9,7 @@ class Migration(migrations.Migration):
99
"""Add optional branch_id field to Setting model."""
1010

1111
dependencies = [
12-
("netbox_diode_plugin", "0006_clientcredentials_alter_setting_diode_target"),
12+
("netbox_diode_plugin", "0007_setting_model_cleanup"),
1313
]
1414

1515
operations = [

0 commit comments

Comments
 (0)