diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-12-16 19:45:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-16 19:45:17 +0100 |
commit | 7efef7db9ed6f7b25a28166c1b75a28adbaf7cdb (patch) | |
tree | ad8ebb28e0466649785afa167e8711debb271e68 /db/migrate | |
parent | d911c17f521d6b13861caa886715a50b644007a1 (diff) | |
parent | 50d62fe2e749a5ab2b2bed81d5a9449b5e733964 (diff) |
Merge pull request #1648 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'db/migrate')
-rw-r--r-- | db/migrate/20211213040746_update_account_summaries_to_version_2.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/db/migrate/20211213040746_update_account_summaries_to_version_2.rb b/db/migrate/20211213040746_update_account_summaries_to_version_2.rb new file mode 100644 index 000000000..0d1f092ec --- /dev/null +++ b/db/migrate/20211213040746_update_account_summaries_to_version_2.rb @@ -0,0 +1,24 @@ +class UpdateAccountSummariesToVersion2 < ActiveRecord::Migration[6.1] + def up + reapplication_follow_recommendations_v2 do + drop_view :account_summaries, materialized: true + create_view :account_summaries, version: 2, materialized: { no_data: true } + safety_assured { add_index :account_summaries, :account_id, unique: true } + end + end + + def down + reapplication_follow_recommendations_v2 do + drop_view :account_summaries, materialized: true + create_view :account_summaries, version: 1, materialized: { no_data: true } + safety_assured { add_index :account_summaries, :account_id, unique: true } + end + end + + def reapplication_follow_recommendations_v2 + drop_view :follow_recommendations, materialized: true + yield + create_view :follow_recommendations, version: 2, materialized: { no_data: true } + safety_assured { add_index :follow_recommendations, :account_id, unique: true } + end +end |