Class: CreateCourseNicknames

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

def change
  create_table :course_nicknames do |t|
    t.bigint :canvas_user_preference_value_id, null: true
    t.integer :canvas_user_id
    t.integer :canvas_course_id
    t.string :nickname

    t.timestamps
  end

  add_index :course_nicknames, :canvas_user_preference_value_id, unique: true
  add_index :course_nicknames, [:canvas_course_id, :canvas_user_id], unique: true
end