Skip to content

Commit

Permalink
Add root_account_id to conversation_participants
Browse files Browse the repository at this point in the history
Closes PLAT-5603
flag=none

Test Plan:
- Verify migrations run
- Verify a root_account_id can be set on a
  ConversationParticipant record
- Verify ConversationParticipant records
  always live on the same shard as their
  root account

Change-Id: I396cd193512cae37976241c73ff6e595b4e6083c
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/235265
Tested-by: Service Cloud Jenkins <[email protected]>
QA-Review: Weston Dransfield <[email protected]>
Product-Review: Weston Dransfield <[email protected]>
Reviewed-by: Rob Orton <[email protected]>
  • Loading branch information
westonkd committed May 27, 2020
1 parent d3000e3 commit 906a773
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Copyright (C) 2020 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.

class AddRootAccountIdToConversationParticipants < ActiveRecord::Migration[5.2]
include MigrationHelpers::AddColumnAndFk

tag :predeploy
disable_ddl_transaction!

def up
add_column_and_fk :conversation_participants, :root_account_id, :accounts
add_index :conversation_participants, :root_account_id, algorithm: :concurrently
end

def down
remove_column :conversation_participants, :root_account_id
end
end

0 comments on commit 906a773

Please sign in to comment.