From 277fbcc231cbf1574f2229d757c372da0c30467e Mon Sep 17 00:00:00 2001 From: Marek Aufart Date: Mon, 17 Jul 2017 10:52:13 +0200 Subject: [PATCH] Add Resource to OpenSCAP results Adding resource_id and resource_type fields to openscap_results table to allow assigning OpenSCAPResult to OpenStack VMs and later also other inventory. Existing container_id association is not touched in this PR, but it could be migrated to polymorphic the resource association in future. --- .../20170717084208_add_resource_to_open_scap_result.rb | 6 ++++++ db/schema.yml | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 db/migrate/20170717084208_add_resource_to_open_scap_result.rb diff --git a/db/migrate/20170717084208_add_resource_to_open_scap_result.rb b/db/migrate/20170717084208_add_resource_to_open_scap_result.rb new file mode 100644 index 000000000..19b1bea9a --- /dev/null +++ b/db/migrate/20170717084208_add_resource_to_open_scap_result.rb @@ -0,0 +1,6 @@ +class AddResourceToOpenScapResult < ActiveRecord::Migration[5.0] + def change + add_column :openscap_results, :resource_id, :bigint + add_column :openscap_results, :resource_type, :string + end +end diff --git a/db/schema.yml b/db/schema.yml index f05dc5e92..5e489868a 100644 --- a/db/schema.yml +++ b/db/schema.yml @@ -5415,6 +5415,8 @@ openscap_results: - id - container_image_id - created_at +- resource_id +- resource_type openscap_rule_results: - id - openscap_result_id