'user' is officially an SQL reserved word, which means that it cannot be
used as a field name. Postgres enforces this so rename it to username.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1017 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/tko/create_db b/tko/create_db
index 33ca9f5..1527b73 100644
--- a/tko/create_db
+++ b/tko/create_db
@@ -25,7 +25,7 @@
job_idx int(10) unsigned NOT NULL auto_increment PRIMARY KEY, -- index number
tag VARCHAR(100), -- job key
label VARCHAR(100), -- job label assigned by user
-user VARCHAR(80), -- user name
+username VARCHAR(80), -- user name
machine_idx int(10) -- reference to machine table
) TYPE=InnoDB;
@@ -85,7 +85,7 @@
CREATE VIEW test_view AS
SELECT tests.test_idx, tests.job_idx, tests.test, tests.subdir,
tests.kernel_idx, tests.status, tests.reason, jobs.machine_idx,
- jobs.tag, jobs.label, jobs.user, machines.hostname,
+ jobs.tag, jobs.label, jobs.username, machines.hostname,
machines.machine_group, machines.owner, kernels.kernel_hash,
kernels.base, kernels.printable
FROM tests
diff --git a/tko/db.py b/tko/db.py
index 6749ef7..5f3498d 100644
--- a/tko/db.py
+++ b/tko/db.py
@@ -171,7 +171,7 @@
commit=commit)
self.insert('jobs', {'tag':tag,
'label': job.label,
- 'user': job.user,
+ 'username': job.user,
'machine_idx':job.machine_idx},
commit=commit)
job.index = self.find_job(tag)
diff --git a/tko/frontend.py b/tko/frontend.py
index 0bd6f65..9b1772c 100755
--- a/tko/frontend.py
+++ b/tko/frontend.py
@@ -18,7 +18,7 @@
'machine_group': ['machine_group', 'machine_idx', 'machine_idx'],
'hostname': ['hostname', 'machine_idx', 'machine_idx'],
'label': ['label', 'job_idx', 'job_idx'],
- 'user': ['user', 'job_idx', 'job_idx'],
+ 'user': ['username', 'job_idx', 'job_idx'],
'test': ['test', 'test', 'test'],
'status': ['word', 'status_idx', 'status'],
'reason': ['reason', 'test_idx', 'test_idx'] }