From 3d48ac938fb274e0edd147d25b06a9fce66c83bb Mon Sep 17 00:00:00 2001 From: Philip Guyton Date: Mon, 10 Feb 2020 20:18:36 +0000 Subject: [PATCH] support longer device names #2026 Increase length our disk model name field from 128 to 192. This accommodates for extra long by id devices names such as have been reported in for example the following SanDisk models: - SanDisk Ultra Fit 64GB USB 3.0 (suspected: SDCZ43) - SanDisk Ultra 32GB USB 3.0 (suspect: SDCZ48-O32G) Includes Django database migration file. --- .../migrations/0009_auto_20200210_1948.py | 19 +++++++++++++++++++ src/rockstor/storageadmin/models/disk.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/rockstor/storageadmin/migrations/0009_auto_20200210_1948.py diff --git a/src/rockstor/storageadmin/migrations/0009_auto_20200210_1948.py b/src/rockstor/storageadmin/migrations/0009_auto_20200210_1948.py new file mode 100644 index 000000000..bf54f35ac --- /dev/null +++ b/src/rockstor/storageadmin/migrations/0009_auto_20200210_1948.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('storageadmin', '0008_auto_20190115_1637'), + ] + + operations = [ + migrations.AlterField( + model_name='disk', + name='name', + field=models.CharField(unique=True, max_length=192), + ), + ] diff --git a/src/rockstor/storageadmin/models/disk.py b/src/rockstor/storageadmin/models/disk.py index 68831e579..b724d0c6c 100644 --- a/src/rockstor/storageadmin/models/disk.py +++ b/src/rockstor/storageadmin/models/disk.py @@ -43,7 +43,7 @@ class Disk(models.Model): in turn are symlinks to sda, sdb etc. eg ata-QEMU_HARDDISK_QM00005 ie mostly derived from model and serial number. """ - name = models.CharField(max_length=128, unique=True) + name = models.CharField(max_length=192, unique=True) """btrfs devid 0 is place holder as real devids start from 1""" devid = models.PositiveSmallIntegerField(default=0) # 0 to 32767 """total size in KB. Zero if btrfs device detached/last stage of delete."""