add submissions.quiz_submission_id fk
Change-Id: I9bbfaf513d4632129f5368a25cb3bd329e5eb47c Reviewed-on: https://gerrit.instructure.com/53094 Tested-by: Jenkins Reviewed-by: Rob Orton <rob@instructure.com> Reviewed-by: Simon Williams <simon@instructure.com> Product-Review: Cody Cutrer <cody@instructure.com> QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
parent
0816b52529
commit
54686f0cea
|
@ -0,0 +1,14 @@
|
|||
class AddSubmissionsQuizSubmissionsForeignKey < ActiveRecord::Migration
|
||||
tag :postdeploy
|
||||
disable_ddl_transaction!
|
||||
|
||||
def up
|
||||
add_index :submissions, :quiz_submission_id, where: "quiz_submission_id IS NOT NULL", algorithm: :concurrently
|
||||
add_foreign_key :submissions, :quiz_submissions, delay_validation: true
|
||||
end
|
||||
|
||||
def down
|
||||
remove_foreign_key :submissions, :quiz_submissions
|
||||
remove_index :submissions, :quiz_submission_id
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue