diff options
author | jadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4> | 2008-06-06 21:10:57 +0000 |
---|---|---|
committer | jadmanski <jadmanski@592f7852-d20e-0410-864c-8624ca9c26a4> | 2008-06-06 21:10:57 +0000 |
commit | 45510bde8d4a2c6d08b2331f723ec5d37b6cdbe2 (patch) | |
tree | 4e2892a8aa650003f797983621cfd86290ead6af /tko/migrations | |
parent | e7e5318f8309211f07a3683fb168d21718f701a7 (diff) |
Convert all python code to use four-space indents instead of eight-space tabs.
Signed-off-by: John Admanski <jadmanski@google.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@1658 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko/migrations')
-rwxr-xr-x | tko/migrations/001_initial_db.py | 180 | ||||
-rw-r--r-- | tko/migrations/002_add_job_timestamps.py | 176 | ||||
-rw-r--r-- | tko/migrations/003_add_test_timestamps.py | 192 | ||||
-rw-r--r-- | tko/migrations/004_add_test_started.py | 196 | ||||
-rw-r--r-- | tko/migrations/005_add_testna_status.py | 4 | ||||
-rw-r--r-- | tko/migrations/006_add_table_query_history.py | 5 | ||||
-rw-r--r-- | tko/migrations/007_widen_reason_field.py | 4 | ||||
-rw-r--r-- | tko/migrations/008_add_iteration_attributes.py | 12 |
8 files changed, 384 insertions, 385 deletions
diff --git a/tko/migrations/001_initial_db.py b/tko/migrations/001_initial_db.py index 2c19abc1..065e5c5c 100755 --- a/tko/migrations/001_initial_db.py +++ b/tko/migrations/001_initial_db.py @@ -1,31 +1,31 @@ import os required_tables = ('machines', 'jobs', 'patches', 'tests', 'test_attributes', - 'iteration_result') + 'iteration_result') def migrate_up(manager): - manager.execute("SHOW TABLES") - tables = [row[0] for row in manager.cursor.fetchall()] - db_initialized = True - for table in required_tables: - if table not in tables: - db_initialized = False - break - if not db_initialized: - response = raw_input( - 'Your tko database does not appear to be initialized. Do ' - 'you want to recreate it (this will result in loss of any ' - 'existing data) (yes/No)? ') - if response != 'yes': - raise Exception('User has chosen to abort migration') - - manager.execute_script(CREATE_DB_SQL) - - manager.create_migrate_table() + manager.execute("SHOW TABLES") + tables = [row[0] for row in manager.cursor.fetchall()] + db_initialized = True + for table in required_tables: + if table not in tables: + db_initialized = False + break + if not db_initialized: + response = raw_input( + 'Your tko database does not appear to be initialized. Do ' + 'you want to recreate it (this will result in loss of any ' + 'existing data) (yes/No)? ') + if response != 'yes': + raise Exception('User has chosen to abort migration') + + manager.execute_script(CREATE_DB_SQL) + + manager.create_migrate_table() def migrate_down(manager): - manager.execute_script(DROP_DB_SQL) + manager.execute_script(DROP_DB_SQL) DROP_DB_SQL = """\ @@ -48,44 +48,44 @@ DROP TABLE IF EXISTS status; CREATE_DB_SQL = DROP_DB_SQL + """\ -- status key CREATE TABLE status ( -status_idx int(10) unsigned NOT NULL auto_increment PRIMARY KEY , -- numerical status -word VARCHAR(10) -- status word +status_idx int(10) unsigned NOT NULL auto_increment PRIMARY KEY , -- numerical status +word VARCHAR(10) -- status word ) TYPE=InnoDB; -- kernel versions CREATE TABLE kernels ( kernel_idx int(10) unsigned NOT NULL auto_increment PRIMARY KEY, -kernel_hash VARCHAR(35), -- Hash of base + all patches -base VARCHAR(30), -- Base version without patches -printable VARCHAR(100) -- Full version with patches +kernel_hash VARCHAR(35), -- Hash of base + all patches +base VARCHAR(30), -- Base version without patches +printable VARCHAR(100) -- Full version with patches ) TYPE=InnoDB; -- machines/hosts table CREATE TABLE machines ( machine_idx int(10) unsigned NOT NULL auto_increment PRIMARY KEY, -hostname VARCHAR(100) unique KEY, -- hostname -machine_group VARCHAR(80), -- group name -owner VARCHAR(80) -- owner name +hostname VARCHAR(100) unique KEY, -- hostname +machine_group VARCHAR(80), -- group name +owner VARCHAR(80) -- owner name ) TYPE=InnoDB; -- main jobs table CREATE TABLE jobs ( -job_idx int(10) unsigned NOT NULL auto_increment PRIMARY KEY, -- index number -tag VARCHAR(100) unique KEY, -- job key +job_idx int(10) unsigned NOT NULL auto_increment PRIMARY KEY, -- index number +tag VARCHAR(100) unique KEY, -- job key label VARCHAR(100), -- job label assigned by user KEY (label), -username VARCHAR(80), -- user name +username VARCHAR(80), -- user name KEY (username), -machine_idx INT(10) unsigned NOT NULL, -- reference to machine table +machine_idx INT(10) unsigned NOT NULL, -- reference to machine table KEY (machine_idx), FOREIGN KEY (machine_idx) REFERENCES machines(machine_idx) ON DELETE CASCADE ) TYPE=InnoDB; -- One entry per patch used, anywhere CREATE TABLE patches ( -kernel_idx INT(10) unsigned NOT NULL, -- index number -name VARCHAR(80), -- short name -url VARCHAR(300), -- full URL +kernel_idx INT(10) unsigned NOT NULL, -- index number +name VARCHAR(80), -- short name +url VARCHAR(300), -- full URL hash VARCHAR(35), KEY (kernel_idx), FOREIGN KEY (kernel_idx) REFERENCES kernels(kernel_idx) ON DELETE CASCADE @@ -93,18 +93,18 @@ FOREIGN KEY (kernel_idx) REFERENCES kernels(kernel_idx) ON DELETE CASCADE -- test functional results CREATE TABLE tests ( -test_idx int(10) unsigned NOT NULL auto_increment PRIMARY KEY, -- index number -job_idx INTEGER, -- ref to job table -test VARCHAR(30), -- name of test -subdir VARCHAR(60), -- subdirectory name -kernel_idx INT(10) unsigned NOT NULL, -- kernel test was AGAINST +test_idx int(10) unsigned NOT NULL auto_increment PRIMARY KEY, -- index number +job_idx INTEGER, -- ref to job table +test VARCHAR(30), -- name of test +subdir VARCHAR(60), -- subdirectory name +kernel_idx INT(10) unsigned NOT NULL, -- kernel test was AGAINST KEY (kernel_idx), FOREIGN KEY (kernel_idx) REFERENCES kernels(kernel_idx) ON DELETE CASCADE, -status int(10) unsigned NOT NULL, -- test status +status int(10) unsigned NOT NULL, -- test status KEY (status), FOREIGN KEY (status) REFERENCES status(status_idx) ON DELETE CASCADE, -reason VARCHAR(100), -- reason for test status -machine_idx INT(10) unsigned NOT NULL, -- reference to machine table +reason VARCHAR(100), -- reason for test status +machine_idx INT(10) unsigned NOT NULL, -- reference to machine table KEY (machine_idx), FOREIGN KEY (machine_idx) REFERENCES machines(machine_idx) ON DELETE CASCADE, invalid BOOL NOT NULL @@ -112,49 +112,49 @@ invalid BOOL NOT NULL -- test attributes (key value pairs at a test level) CREATE TABLE test_attributes ( -test_idx int(10) unsigned NOT NULL, -- ref to test table +test_idx int(10) unsigned NOT NULL, -- ref to test table FOREIGN KEY (test_idx) REFERENCES tests(test_idx) ON DELETE CASCADE, -attribute VARCHAR(30), -- attribute name (e.g. 'version') -value VARCHAR(100), -- attribute value +attribute VARCHAR(30), -- attribute name (e.g. 'version') +value VARCHAR(100), -- attribute value KEY `test_idx` (`test_idx`) ) TYPE=InnoDB; -- test performance results CREATE TABLE iteration_result( -test_idx int(10) unsigned NOT NULL, -- ref to test table +test_idx int(10) unsigned NOT NULL, -- ref to test table FOREIGN KEY (test_idx) REFERENCES tests(test_idx) ON DELETE CASCADE, -iteration INTEGER, -- integer -attribute VARCHAR(30), -- attribute name (e.g. 'throughput') -value FLOAT, -- attribute value (eg 700.1) +iteration INTEGER, -- integer +attribute VARCHAR(30), -- attribute name (e.g. 'throughput') +value FLOAT, -- attribute value (eg 700.1) KEY `test_idx` (`test_idx`) ) TYPE=InnoDB; -- BRRD syncronization CREATE TABLE brrd_sync ( -test_idx int(10) unsigned NOT NULL, -- ref to test table +test_idx int(10) unsigned NOT NULL, -- ref to test table FOREIGN KEY (test_idx) REFERENCES tests(test_idx) ON DELETE CASCADE ) TYPE=InnoDB; -- test_view (to make life easier for people trying to mine data) CREATE VIEW test_view AS -SELECT tests.test_idx, - tests.job_idx, - tests.test, - tests.subdir, - tests.kernel_idx, - tests.status, - tests.reason, - tests.machine_idx, - jobs.tag AS job_tag, - jobs.label AS job_label, - jobs.username AS job_username, - machines.hostname AS machine_hostname, - machines.machine_group, - machines.owner AS machine_owner, - kernels.kernel_hash, - kernels.base AS kernel_base, - kernels.printable AS kernel_printable, - status.word AS status_word +SELECT tests.test_idx, + tests.job_idx, + tests.test, + tests.subdir, + tests.kernel_idx, + tests.status, + tests.reason, + tests.machine_idx, + jobs.tag AS job_tag, + jobs.label AS job_label, + jobs.username AS job_username, + machines.hostname AS machine_hostname, + machines.machine_group, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel_printable, + status.word AS status_word FROM tests INNER JOIN jobs ON jobs.job_idx = tests.job_idx INNER JOIN machines ON machines.machine_idx = jobs.machine_idx @@ -163,27 +163,27 @@ INNER JOIN status ON status.status_idx = tests.status; -- perf_view (to make life easier for people trying to mine performance data) CREATE VIEW perf_view AS -SELECT tests.test_idx, - tests.job_idx, - tests.test, - tests.subdir, - tests.kernel_idx, - tests.status, - tests.reason, - tests.machine_idx, - jobs.tag AS job_tag, - jobs.label AS job_label, - jobs.username AS job_username, - machines.hostname AS machine_hostname, - machines.machine_group, - machines.owner AS machine_owner, - kernels.kernel_hash, - kernels.base AS kernel_base, - kernels.printable AS kernel_printable, - status.word AS status_word, - iteration_result.iteration, - iteration_result.attribute AS iteration_key, - iteration_result.value AS iteration_value +SELECT tests.test_idx, + tests.job_idx, + tests.test, + tests.subdir, + tests.kernel_idx, + tests.status, + tests.reason, + tests.machine_idx, + jobs.tag AS job_tag, + jobs.label AS job_label, + jobs.username AS job_username, + machines.hostname AS machine_hostname, + machines.machine_group, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel_printable, + status.word AS status_word, + iteration_result.iteration, + iteration_result.attribute AS iteration_key, + iteration_result.value AS iteration_value FROM tests INNER JOIN jobs ON jobs.job_idx = tests.job_idx INNER JOIN machines ON machines.machine_idx = jobs.machine_idx diff --git a/tko/migrations/002_add_job_timestamps.py b/tko/migrations/002_add_job_timestamps.py index 8bbb83a3..7cd50043 100644 --- a/tko/migrations/002_add_job_timestamps.py +++ b/tko/migrations/002_add_job_timestamps.py @@ -1,11 +1,11 @@ def migrate_up(manager): - manager.execute_script(ADD_COLUMNS_SQL) - manager.execute_script(ALTER_VIEWS_UP_SQL) + manager.execute_script(ADD_COLUMNS_SQL) + manager.execute_script(ALTER_VIEWS_UP_SQL) def migrate_down(manager): - manager.execute_script(DROP_COLUMNS_SQL) - manager.execute_script(ALTER_VIEWS_DOWN_SQL) + manager.execute_script(DROP_COLUMNS_SQL) + manager.execute_script(ALTER_VIEWS_DOWN_SQL) ADD_COLUMNS_SQL = """\ @@ -22,27 +22,27 @@ ALTER TABLE jobs DROP queued_time, DROP started_time, DROP finished_time; ALTER_VIEWS_UP_SQL = """\ ALTER VIEW test_view AS -SELECT tests.test_idx, - tests.job_idx, - tests.test, - tests.subdir, - tests.kernel_idx, - tests.status, - tests.reason, - tests.machine_idx, - jobs.tag AS job_tag, - jobs.label AS job_label, - jobs.username AS job_username, - jobs.queued_time AS job_queued_time, - jobs.started_time AS job_started_time, - jobs.finished_time AS job_finished_time, - machines.hostname AS machine_hostname, - machines.machine_group, - machines.owner AS machine_owner, - kernels.kernel_hash, - kernels.base AS kernel_base, - kernels.printable AS kernel_printable, - status.word AS status_word +SELECT tests.test_idx, + tests.job_idx, + tests.test, + tests.subdir, + tests.kernel_idx, + tests.status, + tests.reason, + tests.machine_idx, + jobs.tag AS job_tag, + jobs.label AS job_label, + jobs.username AS job_username, + jobs.queued_time AS job_queued_time, + jobs.started_time AS job_started_time, + jobs.finished_time AS job_finished_time, + machines.hostname AS machine_hostname, + machines.machine_group, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel_printable, + status.word AS status_word FROM tests INNER JOIN jobs ON jobs.job_idx = tests.job_idx INNER JOIN machines ON machines.machine_idx = jobs.machine_idx @@ -51,30 +51,30 @@ INNER JOIN status ON status.status_idx = tests.status; -- perf_view (to make life easier for people trying to mine performance data) ALTER VIEW perf_view AS -SELECT tests.test_idx, - tests.job_idx, - tests.test, - tests.subdir, - tests.kernel_idx, - tests.status, - tests.reason, - tests.machine_idx, - jobs.tag AS job_tag, - jobs.label AS job_label, - jobs.username AS job_username, - jobs.queued_time AS job_queued_time, - jobs.started_time AS job_started_time, - jobs.finished_time AS job_finished_time, - machines.hostname AS machine_hostname, - machines.machine_group, - machines.owner AS machine_owner, - kernels.kernel_hash, - kernels.base AS kernel_base, - kernels.printable AS kernel_printable, - status.word AS status_word, - iteration_result.iteration, - iteration_result.attribute AS iteration_key, - iteration_result.value AS iteration_value +SELECT tests.test_idx, + tests.job_idx, + tests.test, + tests.subdir, + tests.kernel_idx, + tests.status, + tests.reason, + tests.machine_idx, + jobs.tag AS job_tag, + jobs.label AS job_label, + jobs.username AS job_username, + jobs.queued_time AS job_queued_time, + jobs.started_time AS job_started_time, + jobs.finished_time AS job_finished_time, + machines.hostname AS machine_hostname, + machines.machine_group, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel_printable, + status.word AS status_word, + iteration_result.iteration, + iteration_result.attribute AS iteration_key, + iteration_result.value AS iteration_value FROM tests INNER JOIN jobs ON jobs.job_idx = tests.job_idx INNER JOIN machines ON machines.machine_idx = jobs.machine_idx @@ -86,24 +86,24 @@ INNER JOIN iteration_result ON iteration_result.test_idx = tests.kernel_idx; ALTER_VIEWS_DOWN_SQL = """\ ALTER VIEW test_view AS -SELECT tests.test_idx, - tests.job_idx, - tests.test, - tests.subdir, - tests.kernel_idx, - tests.status, - tests.reason, - tests.machine_idx, - jobs.tag AS job_tag, - jobs.label AS job_label, - jobs.username AS job_username, - machines.hostname AS machine_hostname, - machines.machine_group, - machines.owner AS machine_owner, - kernels.kernel_hash, - kernels.base AS kernel_base, - kernels.printable AS kernel_printable, - status.word AS status_word +SELECT tests.test_idx, + tests.job_idx, + tests.test, + tests.subdir, + tests.kernel_idx, + tests.status, + tests.reason, + tests.machine_idx, + jobs.tag AS job_tag, + jobs.label AS job_label, + jobs.username AS job_username, + machines.hostname AS machine_hostname, + machines.machine_group, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel_printable, + status.word AS status_word FROM tests INNER JOIN jobs ON jobs.job_idx = tests.job_idx INNER JOIN machines ON machines.machine_idx = jobs.machine_idx @@ -112,27 +112,27 @@ INNER JOIN status ON status.status_idx = tests.status; -- perf_view (to make life easier for people trying to mine performance data) ALTER VIEW perf_view AS -SELECT tests.test_idx, - tests.job_idx, - tests.test, - tests.subdir, - tests.kernel_idx, - tests.status, - tests.reason, - tests.machine_idx, - jobs.tag AS job_tag, - jobs.label AS job_label, - jobs.username AS job_username, - machines.hostname AS machine_hostname, - machines.machine_group, - machines.owner AS machine_owner, - kernels.kernel_hash, - kernels.base AS kernel_base, - kernels.printable AS kernel_printable, - status.word AS status_word, - iteration_result.iteration, - iteration_result.attribute AS iteration_key, - iteration_result.value AS iteration_value +SELECT tests.test_idx, + tests.job_idx, + tests.test, + tests.subdir, + tests.kernel_idx, + tests.status, + tests.reason, + tests.machine_idx, + jobs.tag AS job_tag, + jobs.label AS job_label, + jobs.username AS job_username, + machines.hostname AS machine_hostname, + machines.machine_group, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel_printable, + status.word AS status_word, + iteration_result.iteration, + iteration_result.attribute AS iteration_key, + iteration_result.value AS iteration_value FROM tests INNER JOIN jobs ON jobs.job_idx = tests.job_idx INNER JOIN machines ON machines.machine_idx = jobs.machine_idx diff --git a/tko/migrations/003_add_test_timestamps.py b/tko/migrations/003_add_test_timestamps.py index e9148cb4..fee4cabc 100644 --- a/tko/migrations/003_add_test_timestamps.py +++ b/tko/migrations/003_add_test_timestamps.py @@ -1,11 +1,11 @@ def migrate_up(manager): - manager.execute_script(ADD_COLUMN_SQL) - manager.execute_script(ALTER_VIEWS_UP_SQL) + manager.execute_script(ADD_COLUMN_SQL) + manager.execute_script(ALTER_VIEWS_UP_SQL) def migrate_down(manager): - manager.execute_script(DROP_COLUMN_SQL) - manager.execute_script(ALTER_VIEWS_DOWN_SQL) + manager.execute_script(DROP_COLUMN_SQL) + manager.execute_script(ALTER_VIEWS_DOWN_SQL) ADD_COLUMN_SQL = """\ @@ -18,28 +18,28 @@ ALTER TABLE tests DROP finished_time; ALTER_VIEWS_UP_SQL = """\ ALTER VIEW test_view AS -SELECT tests.test_idx, - tests.job_idx, - tests.test, - tests.subdir, - tests.kernel_idx, - tests.status, - tests.reason, - tests.machine_idx, - tests.finished_time AS test_finished_time, - jobs.tag AS job_tag, - jobs.label AS job_label, - jobs.username AS job_username, - jobs.queued_time AS job_queued_time, - jobs.started_time AS job_started_time, - jobs.finished_time AS job_finished_time, - machines.hostname AS machine_hostname, - machines.machine_group, - machines.owner AS machine_owner, - kernels.kernel_hash, - kernels.base AS kernel_base, - kernels.printable AS kernel_printable, - status.word AS status_word +SELECT tests.test_idx, + tests.job_idx, + tests.test, + tests.subdir, + tests.kernel_idx, + tests.status, + tests.reason, + tests.machine_idx, + tests.finished_time AS test_finished_time, + jobs.tag AS job_tag, + jobs.label AS job_label, + jobs.username AS job_username, + jobs.queued_time AS job_queued_time, + jobs.started_time AS job_started_time, + jobs.finished_time AS job_finished_time, + machines.hostname AS machine_hostname, + machines.machine_group, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel_printable, + status.word AS status_word FROM tests INNER JOIN jobs ON jobs.job_idx = tests.job_idx INNER JOIN machines ON machines.machine_idx = jobs.machine_idx @@ -48,31 +48,31 @@ INNER JOIN status ON status.status_idx = tests.status; -- perf_view (to make life easier for people trying to mine performance data) ALTER VIEW perf_view AS -SELECT tests.test_idx, - tests.job_idx, - tests.test, - tests.subdir, - tests.kernel_idx, - tests.status, - tests.reason, - tests.machine_idx, - tests.finished_time AS test_finished_time, - jobs.tag AS job_tag, - jobs.label AS job_label, - jobs.username AS job_username, - jobs.queued_time AS job_queued_time, - jobs.started_time AS job_started_time, - jobs.finished_time AS job_finished_time, - machines.hostname AS machine_hostname, - machines.machine_group, - machines.owner AS machine_owner, - kernels.kernel_hash, - kernels.base AS kernel_base, - kernels.printable AS kernel_printable, - status.word AS status_word, - iteration_result.iteration, - iteration_result.attribute AS iteration_key, - iteration_result.value AS iteration_value +SELECT tests.test_idx, + tests.job_idx, + tests.test, + tests.subdir, + tests.kernel_idx, + tests.status, + tests.reason, + tests.machine_idx, + tests.finished_time AS test_finished_time, + jobs.tag AS job_tag, + jobs.label AS job_label, + jobs.username AS job_username, + jobs.queued_time AS job_queued_time, + jobs.started_time AS job_started_time, + jobs.finished_time AS job_finished_time, + machines.hostname AS machine_hostname, + machines.machine_group, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel_printable, + status.word AS status_word, + iteration_result.iteration, + iteration_result.attribute AS iteration_key, + iteration_result.value AS iteration_value FROM tests INNER JOIN jobs ON jobs.job_idx = tests.job_idx INNER JOIN machines ON machines.machine_idx = jobs.machine_idx @@ -84,27 +84,27 @@ INNER JOIN iteration_result ON iteration_result.test_idx = tests.kernel_idx; ALTER_VIEWS_DOWN_SQL = """\ ALTER VIEW test_view AS -SELECT tests.test_idx, - tests.job_idx, - tests.test, - tests.subdir, - tests.kernel_idx, - tests.status, - tests.reason, - tests.machine_idx, - jobs.tag AS job_tag, - jobs.label AS job_label, - jobs.username AS job_username, - jobs.queued_time AS job_queued_time, - jobs.started_time AS job_started_time, - jobs.finished_time AS job_finished_time, - machines.hostname AS machine_hostname, - machines.machine_group, - machines.owner AS machine_owner, - kernels.kernel_hash, - kernels.base AS kernel_base, - kernels.printable AS kernel_printable, - status.word AS status_word +SELECT tests.test_idx, + tests.job_idx, + tests.test, + tests.subdir, + tests.kernel_idx, + tests.status, + tests.reason, + tests.machine_idx, + jobs.tag AS job_tag, + jobs.label AS job_label, + jobs.username AS job_username, + jobs.queued_time AS job_queued_time, + jobs.started_time AS job_started_time, + jobs.finished_time AS job_finished_time, + machines.hostname AS machine_hostname, + machines.machine_group, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel_printable, + status.word AS status_word FROM tests INNER JOIN jobs ON jobs.job_idx = tests.job_idx INNER JOIN machines ON machines.machine_idx = jobs.machine_idx @@ -113,30 +113,30 @@ INNER JOIN status ON status.status_idx = tests.status; -- perf_view (to make life easier for people trying to mine performance data) ALTER VIEW perf_view AS -SELECT tests.test_idx, - tests.job_idx, - tests.test, - tests.subdir, - tests.kernel_idx, - tests.status, - tests.reason, - tests.machine_idx, - jobs.tag AS job_tag, - jobs.label AS job_label, - jobs.username AS job_username, - jobs.queued_time AS job_queued_time, - jobs.started_time AS job_started_time, - jobs.finished_time AS job_finished_time, - machines.hostname AS machine_hostname, - machines.machine_group, - machines.owner AS machine_owner, - kernels.kernel_hash, - kernels.base AS kernel_base, - kernels.printable AS kernel_printable, - status.word AS status_word, - iteration_result.iteration, - iteration_result.attribute AS iteration_key, - iteration_result.value AS iteration_value +SELECT tests.test_idx, + tests.job_idx, + tests.test, + tests.subdir, + tests.kernel_idx, + tests.status, + tests.reason, + tests.machine_idx, + jobs.tag AS job_tag, + jobs.label AS job_label, + jobs.username AS job_username, + jobs.queued_time AS job_queued_time, + jobs.started_time AS job_started_time, + jobs.finished_time AS job_finished_time, + machines.hostname AS machine_hostname, + machines.machine_group, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel_printable, + status.word AS status_word, + iteration_result.iteration, + iteration_result.attribute AS iteration_key, + iteration_result.value AS iteration_value FROM tests INNER JOIN jobs ON jobs.job_idx = tests.job_idx INNER JOIN machines ON machines.machine_idx = jobs.machine_idx diff --git a/tko/migrations/004_add_test_started.py b/tko/migrations/004_add_test_started.py index f3d9f3d9..cf910644 100644 --- a/tko/migrations/004_add_test_started.py +++ b/tko/migrations/004_add_test_started.py @@ -1,11 +1,11 @@ def migrate_up(manager): - manager.execute_script(ADD_COLUMN_SQL) - manager.execute_script(ALTER_VIEWS_UP_SQL) + manager.execute_script(ADD_COLUMN_SQL) + manager.execute_script(ALTER_VIEWS_UP_SQL) def migrate_down(manager): - manager.execute_script(DROP_COLUMN_SQL) - manager.execute_script(ALTER_VIEWS_DOWN_SQL) + manager.execute_script(DROP_COLUMN_SQL) + manager.execute_script(ALTER_VIEWS_DOWN_SQL) ADD_COLUMN_SQL = """\ @@ -18,29 +18,29 @@ ALTER TABLE tests DROP started_time; ALTER_VIEWS_UP_SQL = """\ ALTER VIEW test_view AS -SELECT tests.test_idx, - tests.job_idx, - tests.test, - tests.subdir, - tests.kernel_idx, - tests.status, - tests.reason, - tests.machine_idx, +SELECT tests.test_idx, + tests.job_idx, + tests.test, + tests.subdir, + tests.kernel_idx, + tests.status, + tests.reason, + tests.machine_idx, tests.started_time AS test_started_time, - tests.finished_time AS test_finished_time, - jobs.tag AS job_tag, - jobs.label AS job_label, - jobs.username AS job_username, - jobs.queued_time AS job_queued_time, - jobs.started_time AS job_started_time, - jobs.finished_time AS job_finished_time, - machines.hostname AS machine_hostname, - machines.machine_group, - machines.owner AS machine_owner, - kernels.kernel_hash, - kernels.base AS kernel_base, - kernels.printable AS kernel_printable, - status.word AS status_word + tests.finished_time AS test_finished_time, + jobs.tag AS job_tag, + jobs.label AS job_label, + jobs.username AS job_username, + jobs.queued_time AS job_queued_time, + jobs.started_time AS job_started_time, + jobs.finished_time AS job_finished_time, + machines.hostname AS machine_hostname, + machines.machine_group, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel_printable, + status.word AS status_word FROM tests INNER JOIN jobs ON jobs.job_idx = tests.job_idx INNER JOIN machines ON machines.machine_idx = jobs.machine_idx @@ -49,32 +49,32 @@ INNER JOIN status ON status.status_idx = tests.status; -- perf_view (to make life easier for people trying to mine performance data) ALTER VIEW perf_view AS -SELECT tests.test_idx, - tests.job_idx, - tests.test, - tests.subdir, - tests.kernel_idx, - tests.status, - tests.reason, - tests.machine_idx, +SELECT tests.test_idx, + tests.job_idx, + tests.test, + tests.subdir, + tests.kernel_idx, + tests.status, + tests.reason, + tests.machine_idx, tests.started_time AS test_started_time, - tests.finished_time AS test_finished_time, - jobs.tag AS job_tag, - jobs.label AS job_label, - jobs.username AS job_username, - jobs.queued_time AS job_queued_time, - jobs.started_time AS job_started_time, - jobs.finished_time AS job_finished_time, - machines.hostname AS machine_hostname, - machines.machine_group, - machines.owner AS machine_owner, - kernels.kernel_hash, - kernels.base AS kernel_base, - kernels.printable AS kernel_printable, - status.word AS status_word, - iteration_result.iteration, - iteration_result.attribute AS iteration_key, - iteration_result.value AS iteration_value + tests.finished_time AS test_finished_time, + jobs.tag AS job_tag, + jobs.label AS job_label, + jobs.username AS job_username, + jobs.queued_time AS job_queued_time, + jobs.started_time AS job_started_time, + jobs.finished_time AS job_finished_time, + machines.hostname AS machine_hostname, + machines.machine_group, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel_printable, + status.word AS status_word, + iteration_result.iteration, + iteration_result.attribute AS iteration_key, + iteration_result.value AS iteration_value FROM tests INNER JOIN jobs ON jobs.job_idx = tests.job_idx INNER JOIN machines ON machines.machine_idx = jobs.machine_idx @@ -85,28 +85,28 @@ INNER JOIN iteration_result ON iteration_result.test_idx = tests.kernel_idx; ALTER_VIEWS_DOWN_SQL = """\ ALTER VIEW test_view AS -SELECT tests.test_idx, - tests.job_idx, - tests.test, - tests.subdir, - tests.kernel_idx, - tests.status, - tests.reason, - tests.machine_idx, - tests.finished_time AS test_finished_time, - jobs.tag AS job_tag, - jobs.label AS job_label, - jobs.username AS job_username, - jobs.queued_time AS job_queued_time, - jobs.started_time AS job_started_time, - jobs.finished_time AS job_finished_time, - machines.hostname AS machine_hostname, - machines.machine_group, - machines.owner AS machine_owner, - kernels.kernel_hash, - kernels.base AS kernel_base, - kernels.printable AS kernel_printable, - status.word AS status_word +SELECT tests.test_idx, + tests.job_idx, + tests.test, + tests.subdir, + tests.kernel_idx, + tests.status, + tests.reason, + tests.machine_idx, + tests.finished_time AS test_finished_time, + jobs.tag AS job_tag, + jobs.label AS job_label, + jobs.username AS job_username, + jobs.queued_time AS job_queued_time, + jobs.started_time AS job_started_time, + jobs.finished_time AS job_finished_time, + machines.hostname AS machine_hostname, + machines.machine_group, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel_printable, + status.word AS status_word FROM tests INNER JOIN jobs ON jobs.job_idx = tests.job_idx INNER JOIN machines ON machines.machine_idx = jobs.machine_idx @@ -115,31 +115,31 @@ INNER JOIN status ON status.status_idx = tests.status; -- perf_view (to make life easier for people trying to mine performance data) ALTER VIEW perf_view AS -SELECT tests.test_idx, - tests.job_idx, - tests.test, - tests.subdir, - tests.kernel_idx, - tests.status, - tests.reason, - tests.machine_idx, - tests.finished_time AS test_finished_time, - jobs.tag AS job_tag, - jobs.label AS job_label, - jobs.username AS job_username, - jobs.queued_time AS job_queued_time, - jobs.started_time AS job_started_time, - jobs.finished_time AS job_finished_time, - machines.hostname AS machine_hostname, - machines.machine_group, - machines.owner AS machine_owner, - kernels.kernel_hash, - kernels.base AS kernel_base, - kernels.printable AS kernel_printable, - status.word AS status_word, - iteration_result.iteration, - iteration_result.attribute AS iteration_key, - iteration_result.value AS iteration_value +SELECT tests.test_idx, + tests.job_idx, + tests.test, + tests.subdir, + tests.kernel_idx, + tests.status, + tests.reason, + tests.machine_idx, + tests.finished_time AS test_finished_time, + jobs.tag AS job_tag, + jobs.label AS job_label, + jobs.username AS job_username, + jobs.queued_time AS job_queued_time, + jobs.started_time AS job_started_time, + jobs.finished_time AS job_finished_time, + machines.hostname AS machine_hostname, + machines.machine_group, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel_printable, + status.word AS status_word, + iteration_result.iteration, + iteration_result.attribute AS iteration_key, + iteration_result.value AS iteration_value FROM tests INNER JOIN jobs ON jobs.job_idx = tests.job_idx INNER JOIN machines ON machines.machine_idx = jobs.machine_idx diff --git a/tko/migrations/005_add_testna_status.py b/tko/migrations/005_add_testna_status.py index e22abe5d..4e4e4807 100644 --- a/tko/migrations/005_add_testna_status.py +++ b/tko/migrations/005_add_testna_status.py @@ -1,6 +1,6 @@ def migrate_up(monger): - monger.execute("INSERT INTO status (word) values ('TEST_NA')") + monger.execute("INSERT INTO status (word) values ('TEST_NA')") def migrate_down(monger): - monger.execute("DELETE FROM status where word = 'TEST_NA'") + monger.execute("DELETE FROM status where word = 'TEST_NA'") diff --git a/tko/migrations/006_add_table_query_history.py b/tko/migrations/006_add_table_query_history.py index 41c5e29d..891836fe 100644 --- a/tko/migrations/006_add_table_query_history.py +++ b/tko/migrations/006_add_table_query_history.py @@ -1,9 +1,9 @@ def migrate_up(manager): - manager.execute_script(ADD_TABLE_QUERY_HISTORY) + manager.execute_script(ADD_TABLE_QUERY_HISTORY) def migrate_down(manager): - manager.execute_script(DROP_TABLE_QUERY_HISTORY) + manager.execute_script(DROP_TABLE_QUERY_HISTORY) ADD_TABLE_QUERY_HISTORY = """ @@ -15,4 +15,3 @@ url VARCHAR(1000)); DROP_TABLE_QUERY_HISTORY = """ DROP TABLE query_history; """ - diff --git a/tko/migrations/007_widen_reason_field.py b/tko/migrations/007_widen_reason_field.py index 7df6bc87..aae2a44e 100644 --- a/tko/migrations/007_widen_reason_field.py +++ b/tko/migrations/007_widen_reason_field.py @@ -1,5 +1,5 @@ def migrate_up(mgr): - mgr.execute("alter table tests modify column reason varchar(1024);") + mgr.execute("alter table tests modify column reason varchar(1024);") def migrate_down(mgr): - mgr.execute("alter table tests modify column reason varchar(100);") + mgr.execute("alter table tests modify column reason varchar(100);") diff --git a/tko/migrations/008_add_iteration_attributes.py b/tko/migrations/008_add_iteration_attributes.py index 4ef176e4..87cd56bf 100644 --- a/tko/migrations/008_add_iteration_attributes.py +++ b/tko/migrations/008_add_iteration_attributes.py @@ -1,18 +1,18 @@ def migrate_up(manager): - manager.execute_script(CREATE_TABLE_SQL) + manager.execute_script(CREATE_TABLE_SQL) def migrate_down(manager): - manager.execute_script(DROP_TABLE_SQL) + manager.execute_script(DROP_TABLE_SQL) CREATE_TABLE_SQL = """ -- test iteration attributes (key value pairs at an iteration level) CREATE TABLE iteration_attributes ( -test_idx int(10) unsigned NOT NULL, -- ref to test table +test_idx int(10) unsigned NOT NULL, -- ref to test table FOREIGN KEY (test_idx) REFERENCES tests(test_idx) ON DELETE CASCADE, -iteration INTEGER, -- integer -attribute VARCHAR(30), -- attribute name (e.g. 'run_id') -value VARCHAR(100), -- attribute value +iteration INTEGER, -- integer +attribute VARCHAR(30), -- attribute name (e.g. 'run_id') +value VARCHAR(100), -- attribute value KEY `test_idx` (`test_idx`) ) TYPE=InnoDB; """ |