class CreateCourseMembers < ActiveRecord::Migration[5.2]
  def change
    create_table :course_members do |t|
      t.integer :course_id
      t.integer :user_id
      t.integer :course_group_id, default: 0
      t.integer :graduation_group_id, default: 0
      t.integer :role, default: 0
      t.boolean :is_active, default: 1

      t.timestamps
    end

    add_index :course_members, :course_id
    add_index :course_members, :user_id
    add_index :course_members, :course_group_id
    add_index :course_members, :graduation_group_id
  end
end
