Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing cascade delete for host_storages #16440

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class Host < ApplicationRecord
has_many :vms_and_templates, :dependent => :nullify
has_many :vms, :inverse_of => :host
has_many :miq_templates, :inverse_of => :host
has_many :host_storages
has_many :host_storages, :dependent => :destroy
has_many :storages, :through => :host_storages
has_many :host_switches, :dependent => :destroy
has_many :switches, :through => :host_switches
Expand Down
2 changes: 1 addition & 1 deletion app/models/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Storage < ApplicationRecord
has_many :vms_and_templates, :foreign_key => :storage_id, :dependent => :nullify, :class_name => "VmOrTemplate"
has_many :miq_templates, :foreign_key => :storage_id
has_many :vms, :foreign_key => :storage_id
has_many :host_storages
has_many :host_storages, :dependent => :destroy
has_many :hosts, :through => :host_storages
has_many :storage_profile_storages, :dependent => :destroy
has_many :storage_profiles, :through => :storage_profile_storages
Expand Down