]> cat aescling's git repositories - mastodon.git/commitdiff
Do not populate AccountSummaries and FollowRecommendation views on migration (#16173)
authorClaire <claire.github-309c@sitedethib.com>
Fri, 7 May 2021 16:14:29 +0000 (18:14 +0200)
committerGitHub <noreply@github.com>
Fri, 7 May 2021 16:14:29 +0000 (18:14 +0200)
Materializing those views can take a while, and they are currently refreshed
anyway each time they are actually used, in the FollowRecommendationsScheduler.

db/migrate/20210322164601_create_account_summaries.rb
db/migrate/20210505174616_update_follow_recommendations_to_version_2.rb

index b9faf180d8a7cae975fb38782527e34e012b2124..bc9011113f78697020f58c46c0f435a859783550 100644 (file)
@@ -1,6 +1,6 @@
 class CreateAccountSummaries < ActiveRecord::Migration[5.2]
   def change
-    create_view :account_summaries, materialized: true
+    create_view :account_summaries, materialized: { no_data: true }
 
     # To be able to refresh the view concurrently,
     # at least one unique index is required
index 9b2a284e4973e909dc8a54666b4cf45d43ff5e3c..56c0b4cb0afa2c0ff2ad62b3f3d7d80ee2b36372 100644 (file)
@@ -4,7 +4,7 @@ class UpdateFollowRecommendationsToVersion2 < ActiveRecord::Migration[6.1]
 
   def up
     drop_view :follow_recommendations
-    create_view :follow_recommendations, version: 2, materialized: true
+    create_view :follow_recommendations, version: 2, materialized: { no_data: true }
 
     # To be able to refresh the view concurrently,
     # at least one unique index is required