Tests with large tags, such as the ones that can appear on the kvm test
can have the fields 'test' and 'subdir' too large. This patch raises
the length of such fields on the autotest_web database to 300.

Changes from v1:

 * Realized that tko/migrations/019_widen_test_name_field.py expands the
original value that test has from 30 to 60, so changed the downgrade
sql statement accordingly.

Signed-off-by: Lucas Meneghel Rodrigues <l...@redhat.com>
---
 .../migrations/052_expand_test_subdir_fields.py    |    9 +++++++++
 frontend/tko/models.py                             |    4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)
 create mode 100644 frontend/migrations/052_expand_test_subdir_fields.py

diff --git a/frontend/migrations/052_expand_test_subdir_fields.py 
b/frontend/migrations/052_expand_test_subdir_fields.py
new file mode 100644
index 0000000..9f2732c
--- /dev/null
+++ b/frontend/migrations/052_expand_test_subdir_fields.py
@@ -0,0 +1,9 @@
+UP_SQL = """
+ALTER TABLE tko_tests MODIFY test varchar(300) default NULL;
+ALTER TABLE tko_tests MODIFY subdir varchar(300) default NULL;
+"""
+
+DOWN_SQL = """
+ALTER TABLE tko_tests MODIFY test varchar(60) default NULL;
+ALTER TABLE tko_tests MODIFY subdir varchar(60) default NULL;
+"""
\ No newline at end of file
diff --git a/frontend/tko/models.py b/frontend/tko/models.py
index 7348b07..e0215a6 100644
--- a/frontend/tko/models.py
+++ b/frontend/tko/models.py
@@ -169,8 +169,8 @@ class Test(dbmodels.Model, model_logic.ModelExtensions,
            model_logic.ModelWithAttributes):
     test_idx = dbmodels.AutoField(primary_key=True)
     job = dbmodels.ForeignKey(Job, db_column='job_idx')
-    test = dbmodels.CharField(max_length=90)
-    subdir = dbmodels.CharField(blank=True, max_length=180)
+    test = dbmodels.CharField(max_length=300)
+    subdir = dbmodels.CharField(blank=True, max_length=300)
     kernel = dbmodels.ForeignKey(Kernel, db_column='kernel_idx')
     status = dbmodels.ForeignKey(Status, db_column='status')
     reason = dbmodels.CharField(blank=True, max_length=3072)
-- 
1.6.6.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to