Store the profile as a string in the database.
Signed-off-by: Nishanth Aravamudan <[email protected]>
---
I'm not entirely sure this is how the 'migration' path is supposed to
work, I didn't find much documentation on it, but I think it resembles
other updates.
database/schema_051.sql | 1 +
frontend/afe/models.py | 1 +
.../069_add_profile_afe_host_queue_entries.py | 7 +++++++
scheduler/scheduler_models.py | 2 +-
4 files changed, 10 insertions(+), 1 deletions(-)
create mode 100644
frontend/migrations/069_add_profile_afe_host_queue_entries.py
diff --git a/database/schema_051.sql b/database/schema_051.sql
index 604651d..4f4eedd 100644
--- a/database/schema_051.sql
+++ b/database/schema_051.sql
@@ -174,6 +174,7 @@ CREATE TABLE `afe_host_queue_entries` (
`id` int(11) NOT NULL auto_increment,
`job_id` int(11) default NULL,
`host_id` int(11) default NULL,
+ `profile` varchar(255) default NULL,
`status` varchar(255) default NULL,
`meta_host` int(11) default NULL,
`active` tinyint(1) default '0',
diff --git a/frontend/afe/models.py b/frontend/afe/models.py
index 171faf2..96c56e9 100644
--- a/frontend/afe/models.py
+++ b/frontend/afe/models.py
@@ -1137,6 +1137,7 @@ class HostQueueEntry(dbmodels.Model,
model_logic.ModelExtensions):
atomic_group = dbmodels.ForeignKey(AtomicGroup, blank=True, null=True)
aborted = dbmodels.BooleanField(default=False)
started_on = dbmodels.DateTimeField(null=True, blank=True)
+ profile = dbmodels.CharField(max_length=255, blank=True, default='')
objects = model_logic.ExtendedManager()
diff --git a/frontend/migrations/069_add_profile_afe_host_queue_entries.py
b/frontend/migrations/069_add_profile_afe_host_queue_entries.py
new file mode 100644
index 0000000..573b67c
--- /dev/null
+++ b/frontend/migrations/069_add_profile_afe_host_queue_entries.py
@@ -0,0 +1,7 @@
+UP_SQL = """
+ALTER TABLE afe_host_queue_entries ADD COLUMN profile VARCHAR(255) AFTER
host_id;
+"""
+
+DOWN_SQL = """
+ALTER TABLE afe_host_queue_entries DROP COLUMN profile;
+"""
diff --git a/scheduler/scheduler_models.py b/scheduler/scheduler_models.py
index 3675397..2f71852 100644
--- a/scheduler/scheduler_models.py
+++ b/scheduler/scheduler_models.py
@@ -429,7 +429,7 @@ class Host(DBObject):
class HostQueueEntry(DBObject):
_table_name = 'afe_host_queue_entries'
- _fields = ('id', 'job_id', 'host_id', 'status', 'meta_host',
+ _fields = ('id', 'job_id', 'host_id', 'profile', 'status', 'meta_host',
'active', 'complete', 'deleted', 'execution_subdir',
'atomic_group_id', 'aborted', 'started_on')
--
1.7.7.6
--
Nishanth Aravamudan <[email protected]>
IBM Linux Technology Center
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest