Class: CreateAssignments

Inherits:
Object
  • Object
show all
Defined in:
lib/canvas_sync/generators/templates/migrations/create_assignments.rb

Overview

<%= autogenerated_migration_warning %>

Instance Method Summary collapse

Instance Method Details

#changeObject



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
# File 'lib/canvas_sync/generators/templates/migrations/create_assignments.rb', line 4

def change
  create_table :assignments do |t|
    t.bigint :canvas_id, null: false
    t.string :title
    t.text :description
    t.datetime :due_at
    t.datetime :unlock_at
    t.datetime :lock_at
    t.float :points_possible
    t.float :min_score
    t.float :max_score
    t.float :mastery_score
    t.string :grading_type
    t.string :submission_types
    t.string :workflow_state
    t.integer :canvas_context_id
    t.string :canvas_context_type
    t.integer :canvas_assignment_group_id
    t.integer :canvas_grading_scheme_id
    t.integer :canvas_grading_standard_id

    t.timestamps
  end

  add_index :assignments, :canvas_id, unique: true
  add_index :assignments, [:canvas_context_id, :canvas_context_type]
end