16306: Merge branch 'master'
[arvados.git] / services / api / db / migrate / 20201103170213_refresh_trashed_groups.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require '20200501150153_permission_table_constants'
6
7 class RefreshTrashedGroups < ActiveRecord::Migration[5.2]
8   def change
9     # The original refresh_trashed query had a bug, it would insert
10     # all trashed rows, including those with null trash_at times.
11     # This went unnoticed because null trash_at behaved the same as
12     # not having those rows at all, but it is inefficient to fetch
13     # rows we'll never use.  That bug is fixed in the original query
14     # but we need another migration to make sure it runs.
15     refresh_trashed
16   end
17 end