Sha256: 8dbf3358cee92bd8c6bd07d14a0570f5100fc6deb713725498cde73632938b8f
Contents?: true
Size: 603 Bytes
Versions: 15
Compression:
Stored size: 603 Bytes
Contents
# This migration comes from fe_engine (originally 20151021184250) class AddQuestionSheetIdInRefs < ActiveRecord::Migration[4.2] def change add_column Fe::ReferenceSheet.table_name, :question_sheet_id, :integer # set initial question_sheet_id on all refs # NOTE: doing an update on a join query is a pain to do in both mysql and postgres # and since there's not that many reference questions, this should be fine Fe::ReferenceQuestion.all.each do |rq| Fe::ReferenceSheet.where(question_id: rq.id).update_all(question_sheet_id: rq.related_question_sheet_id) end end end
Version data entries
15 entries across 15 versions & 1 rubygems