Sha256: 96b6f21db2fceac6cc079ace47ddb7ec885460b4ad7d8e9ed52a36d458295247
Contents?: true
Size: 300 Bytes
Versions: 10
Compression:
Stored size: 300 Bytes
Contents
class RemoveOrphanedAssetPolicies < ActiveRecord::Migration[6.0] def up orphaned_asset_policy_ids = ForemanOpenscap::AssetPolicy.left_outer_joins(:asset).where(asset: { id: nil }).pluck(:asset_id) ForemanOpenscap::AssetPolicy.where(asset_id: orphaned_asset_policy_ids).delete_all end end
Version data entries
10 entries across 10 versions & 1 rubygems