Skip to content

Commit

Permalink
Merge pull request #14295 from moolitayer/mas_model_changes
Browse files Browse the repository at this point in the history
Miq Alert Status model changes for resolved alerts
  • Loading branch information
Fryguy authored Mar 16, 2017
2 parents f20cab8 + 5ef9392 commit a9e013d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
3 changes: 0 additions & 3 deletions app/models/miq_alert_status.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
require 'ancestry'

class MiqAlertStatus < ApplicationRecord
SEVERITY_LEVELS = %w(error warning info).freeze

has_ancestry
belongs_to :miq_alert
belongs_to :resource, :polymorphic => true
belongs_to :ext_management_system
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20170309111313_add_resolved_to_alerts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddResolvedToAlerts < ActiveRecord::Migration[5.0]
def change
add_column :miq_alert_statuses, :resolved, :boolean
end
end
6 changes: 6 additions & 0 deletions db/migrate/20170309125642_add_alert_ems_ref.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddAlertEmsRef < ActiveRecord::Migration[5.0]
def change
add_column :miq_alert_statuses, :event_ems_ref, :string
add_index :miq_alert_statuses, :event_ems_ref
end
end
6 changes: 6 additions & 0 deletions db/migrate/20170313160354_remove_ancestry_from_alerts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class RemoveAncestryFromAlerts < ActiveRecord::Migration[5.0]
def change
remove_index :miq_alert_statuses, :ancestry
remove_column :miq_alert_statuses, :ancestry, :string
end
end
3 changes: 2 additions & 1 deletion db/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4868,10 +4868,11 @@ miq_alert_statuses:
- result
- url
- severity
- ancestry
- acknowledged
- ems_id
- description
- resolved
- event_ems_ref
miq_alerts:
- id
- guid
Expand Down

0 comments on commit a9e013d

Please sign in to comment.