Class: CreateSubmissions

Inherits:
Object
  • Object
show all
Defined in:
lib/canvas_sync/generators/templates/migrations/create_submissions.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
# File 'lib/canvas_sync/generators/templates/migrations/create_submissions.rb', line 4

def change
  create_table :submissions do |t|
    t.bigint :canvas_id, null: false
    t.bigint :canvas_course_id
    t.bigint :canvas_assignment_id
    t.bigint :canvas_user_id
    t.datetime :submitted_at
    t.datetime :due_at
    t.datetime :graded_at
    t.float :score
    t.float :points_possible
    t.boolean :excused
    t.string :workflow_state

    t.timestamps
  end

  add_index :submissions, :canvas_id, unique: true
  add_index :submissions, :canvas_assignment_id
  add_index :submissions, :canvas_course_id
  add_index :submissions, :canvas_user_id
end