Browse Source

Closes #894: Expand device name max length to 64 characters

Jeremy Stretch 8 years ago
parent
commit
cc31c8fc33
2 changed files with 22 additions and 1 deletions
  1. 21 0
      netbox/dcim/migrations/0032_device_increase_name_length.py
  2. 1 1
      netbox/dcim/models.py

+ 21 - 0
netbox/dcim/migrations/0032_device_increase_name_length.py

@@ -0,0 +1,21 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.10.4 on 2017-03-02 15:09
+from __future__ import unicode_literals
+
+from django.db import migrations
+import utilities.fields
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('dcim', '0031_regions'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='device',
+            name='name',
+            field=utilities.fields.NullableCharField(blank=True, max_length=64, null=True, unique=True),
+        ),
+    ]

+ 1 - 1
netbox/dcim/models.py

@@ -915,7 +915,7 @@ class Device(CreatedUpdatedModel, CustomFieldModel):
     device_role = models.ForeignKey('DeviceRole', related_name='devices', on_delete=models.PROTECT)
     tenant = models.ForeignKey(Tenant, blank=True, null=True, related_name='devices', on_delete=models.PROTECT)
     platform = models.ForeignKey('Platform', related_name='devices', blank=True, null=True, on_delete=models.SET_NULL)
-    name = NullableCharField(max_length=50, blank=True, null=True, unique=True)
+    name = NullableCharField(max_length=64, blank=True, null=True, unique=True)
     serial = models.CharField(max_length=50, blank=True, verbose_name='Serial number')
     asset_tag = NullableCharField(max_length=50, blank=True, null=True, unique=True, verbose_name='Asset tag',
                                   help_text='A unique tag used to identify this device')