Class: CreateScores
- Inherits:
-
Object
- Object
- CreateScores
- Defined in:
- lib/canvas_sync/generators/templates/migrations/create_scores.rb
Overview
<%= autogenerated_migration_warning %>
Instance Method Summary collapse
Instance Method Details
#change ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/canvas_sync/generators/templates/migrations/create_scores.rb', line 4 def change create_table :scores do |t| t.bigint :canvas_id, null: false t.bigint :canvas_enrollment_id, null: false t.bigint :canvas_assignment_group_id t.bigint :canvas_grading_period_id t.float :current_score t.float :unposted_current_score t.string :workflow_state, default: :active, null: false, limit: 255 t.float :final_score t.boolean :course_score, default: false, null: false t.float :unposted_final_score t.float :current_points t.float :unposted_current_points t.float :final_points t.float :unposted_final_points t.float :override_score t. end add_index :scores, :canvas_id, unique: true add_index :scores, :canvas_enrollment_id, unique: true, where: 'course_score' add_index :scores, [:canvas_enrollment_id, :canvas_assignment_group_id], unique: true, where: 'canvas_assignment_group_id IS NOT NULL', name: 'index_scores_on_canvas_enrollment_id_and_assignment_group_id' add_index :scores, [:canvas_enrollment_id, :canvas_grading_period_id], unique: true, where: 'canvas_grading_period_id IS NOT NULL', name: 'index_scores_on_canvas_enrollment_id_and_grading_period_id' end |