Sha256: 6ea9b722421ec2c5aea9a46b7789bd5ce91f193828fa8314d27b193049d15292
Contents?: true
Size: 839 Bytes
Versions: 17
Compression:
Stored size: 839 Bytes
Contents
class CreateScaptimonyArfReportBreakdowns < ActiveRecord::Migration def self.up execute <<-SQL CREATE VIEW scaptimony_arf_report_breakdowns AS SELECT arf.id as arf_report_id, COUNT(CASE WHEN result.name IN ('pass','fixed') THEN 1 ELSE null END) as passed, COUNT(CASE result.name WHEN 'fail' THEN 1 ELSE null END) as failed, COUNT(CASE WHEN result.name NOT IN ('pass', 'fixed', 'fail', 'notselected', 'notapplicable') THEN 1 ELSE null END) as othered FROM scaptimony_arf_reports arf, scaptimony_xccdf_rule_results rule, scaptimony_xccdf_results result WHERE arf.id = rule.arf_report_id AND rule.xccdf_result_id = result.id GROUP BY arf.id; SQL end def self.down execute 'DROP VIEW scaptimony_arf_report_breakdowns' if table_exists? 'scaptimony_arf_report_breakdowns' end end
Version data entries
17 entries across 17 versions & 2 rubygems