fix migration

fixing ability to run, not effect of running. if you already
successfully ran the migration, you don't need to rerun it. if you
haven't successfully run it, now you can. so it's kosher to fix in
place.

manually tested with full test-plan (i.e. putting migratable data in
place) this time.

Change-Id: I0db5b800a0a08a3865fd7f926c6fe8e833a88cea
test-plan:
  * create graded discussion
  * participate in discussion as student
  * in script/console, delete the corresponding submission
  * run migration
  * verify submission was recreated
Reviewed-on: https://gerrit.instructure.com/6904
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
This commit is contained in:
Jacob Fugal 2011-11-11 15:19:46 -07:00
parent 84e766de0d
commit 23ebfa123e
1 changed files with 2 additions and 1 deletions

View File

@ -62,8 +62,9 @@ class EnsureSubmissionsForDiscussions < ActiveRecord::Migration
groups.group_category_id=#{assignment.group_category_id}
LIMIT 1
SQL
group_id = group && group.id
homework = Submission.build(
homework = Submission.new(
:assignment_id => assignment.id,
:user_id => entry.user_id,
:group_id => group_id,