Sha256: c6cac2423b8466c3a01351a74366e706d3b25dd12d5629c5068cf2840d541cbf
Contents?: true
Size: 266 Bytes
Versions: 33
Compression:
Stored size: 266 Bytes
Contents
class DeleteOrphanStatuses < ActiveRecord::Migration[5.0] def up ids = Shipit::Status.left_joins(:commit).where(commits: {id: nil}).pluck(:id) say "Found #{ids.size} orphan statuses" Shipit::Status.where(id: ids).delete_all end def down end end
Version data entries
33 entries across 33 versions & 1 rubygems