Class: CreateUserObservers

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

def change
  create_table :user_observers do |t|
    t.bigint :observing_user_id
    t.bigint :observed_user_id
    t.string :workflow_state

    t.timestamps
  end

  add_index :user_observers, [:observed_user_id, :observing_user_id], unique: true
  add_index :user_observers, :observing_user_id
  add_index :user_observers, :observed_user_id
end