docbrown/db/migrate/20180816165158_create_mentor_relationships.rb
Jess Lee 4451e5eb38 Update User Dashboard With Mentorship Admin Features (#440)
* create mentor relationship table and begin dashboard

* add missing files from previous commit

* add mentorship relationship status

* remove uniqueness validation

* add multiple notes

* ban from mentorship deactives all relationships

* add untracked files

* fix logic issue and add specs

* add model specs

* add request specs

* add request specs and fix linting

* fix internal users spec

* remove phantom columns

* remove bizzaro character

* move all attr_accessor to one line
2018-09-11 15:59:25 -04:00

13 lines
449 B
Ruby

class CreateMentorRelationships < ActiveRecord::Migration[5.1]
def change
create_table :mentor_relationships do |t|
t.integer :mentor_id, null: false
t.integer :mentee_id, null: false
t.boolean :active, default: true
t.timestamps
end
add_index :mentor_relationships, :mentee_id
add_index :mentor_relationships, :mentor_id
add_index :mentor_relationships, %i[mentee_id mentor_id], unique: true
end
end