18691: Update database indexes for frozen_by_uuid.
authorTom Clegg <tom@curii.com>
Thu, 3 Mar 2022 21:28:04 +0000 (16:28 -0500)
committerTom Clegg <tom@curii.com>
Thu, 3 Mar 2022 21:28:04 +0000 (16:28 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

services/api/app/models/group.rb
services/api/db/migrate/20220303204419_add_frozen_by_uuid_to_group_search_index.rb [new file with mode: 0644]
services/api/db/structure.sql

index e3df460298f2182d6399898f7f9eeeeb0c8533ff..216397a1bbf0a9a3efe2a9060e855ff689d5ad98 100644 (file)
@@ -250,4 +250,8 @@ on conflict (group_uuid) do update set trash_at=EXCLUDED.trash_at;
       return true
     end
   end
+
+  def self.full_text_searchable_columns
+    super - ["frozen_by_uuid"]
+  end
 end
diff --git a/services/api/db/migrate/20220303204419_add_frozen_by_uuid_to_group_search_index.rb b/services/api/db/migrate/20220303204419_add_frozen_by_uuid_to_group_search_index.rb
new file mode 100644 (file)
index 0000000..52fb16b
--- /dev/null
@@ -0,0 +1,17 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
+class AddFrozenByUuidToGroupSearchIndex < ActiveRecord::Migration[5.0]
+  disable_ddl_transaction!
+
+  def up
+    remove_index :groups, :name => 'groups_search_index'
+    add_index :groups, ["uuid", "owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid", "name", "group_class", "frozen_by_uuid"], name: 'groups_search_index', algorithm: :concurrently
+  end
+
+  def down
+    remove_index :groups, :name => 'groups_search_index'
+    add_index :groups, ["uuid", "owner_uuid", "modified_by_client_uuid", "modified_by_user_uuid", "name", "group_class"], name: 'groups_search_index', algorithm: :concurrently
+  end
+end
index cf92bcad907b443f11953e9809f2410adf974934..cfe21f7c9ae29307b42fd25236a1f4c195254da0 100644 (file)
@@ -1803,7 +1803,7 @@ CREATE INDEX group_index_on_properties ON public.groups USING gin (properties);
 -- Name: groups_search_index; Type: INDEX; Schema: public; Owner: -
 --
 
-CREATE INDEX groups_search_index ON public.groups USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, name, group_class);
+CREATE INDEX groups_search_index ON public.groups USING btree (uuid, owner_uuid, modified_by_client_uuid, modified_by_user_uuid, name, group_class, frozen_by_uuid);
 
 
 --
@@ -3184,6 +3184,7 @@ INSERT INTO "schema_migrations" (version) VALUES
 ('20210816191509'),
 ('20211027154300'),
 ('20220224203102'),
-('20220301155729');
+('20220301155729'),
+('20220303204419');