Home | History | Annotate | Download | only in migrations
      1 prev_migration = __import__('015_support_graphing_interface')
      2 
      3 def migrate_up(manager):
      4     manager.execute(prev_migration.DROP_PERF_VIEW_2)
      5     manager.execute(CREATE_NEW_PERF_VIEW_2)
      6 
      7 def migrate_down(manager):
      8     manager.execute(prev_migration.DROP_PERF_VIEW_2)
      9     manager.execute(prev_migration.CREATE_PERF_VIEW_2)
     10 
     11 CREATE_NEW_PERF_VIEW_2 = """\
     12 CREATE VIEW perf_view_2 AS
     13 SELECT  tests.test_idx,
     14         tests.job_idx,
     15         tests.test AS test_name,
     16         tests.subdir,
     17         tests.kernel_idx,
     18         tests.status AS status_idx,
     19         tests.reason,
     20         tests.machine_idx,
     21         tests.started_time AS test_started_time,
     22         tests.finished_time AS test_finished_time,
     23         jobs.tag AS job_tag,
     24         jobs.label AS job_name,
     25         jobs.username AS job_owner,
     26         jobs.queued_time AS job_queued_time,
     27         jobs.started_time AS job_started_time,
     28         jobs.finished_time AS job_finished_time,
     29         machines.hostname AS hostname,
     30         machines.machine_group AS platform,
     31         machines.owner AS machine_owner,
     32         kernels.kernel_hash,
     33         kernels.base AS kernel_base,
     34         kernels.printable AS kernel,
     35         status.word AS status,
     36         iteration_result.iteration,
     37         iteration_result.attribute AS iteration_key,
     38         iteration_result.value AS iteration_value
     39 FROM tests
     40 LEFT OUTER JOIN jobs ON jobs.job_idx = tests.job_idx
     41 LEFT OUTER JOIN machines ON machines.machine_idx = jobs.machine_idx
     42 LEFT OUTER JOIN kernels ON kernels.kernel_idx = tests.kernel_idx
     43 LEFT OUTER JOIN status ON status.status_idx = tests.status
     44 LEFT OUTER JOIN iteration_result ON iteration_result.test_idx = tests.test_idx;
     45 """
     46