Class: CreateLearningOutcomes

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

def change
  create_table :learning_outcomes do |t|
    t.bigint :canvas_id, null: false
    t.integer :canvas_context_id
    t.string :canvas_context_type
    t.string :name
    t.string :friendly_name
    t.string :workflow_state
    t.datetime :canvas_created_at
    t.datetime :canvas_updated_at
    t.string :migration_id
    t.string :vendor_guid
    t.string :low_grade
    t.string :high_grade
    t.string :calculation_method
    t.string :calculation_int
    t.integer :outcome_import_id
    t.integer :root_account_ids, array: true, default: []
    t.text :description

    t.timestamps
  end

  add_index :learning_outcomes, :canvas_id, unique: true
  add_index :learning_outcomes, [:canvas_context_id, :canvas_context_type], name: "index_learning_outcomes_on_context"
end