Class: CreateOproAuthGrants

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/active_record/templates/auth_grants.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/generators/active_record/templates/auth_grants.rb', line 2

def change
  create_table  :opro_auth_grants do |t|
    t.string    :code
    t.string    :access_token
    t.string    :refresh_token
    t.text      :permissions
    t.datetime  :access_token_expires_at
    t.integer   :user_id
    t.integer   :application_id

    t.timestamps
  end

  add_index :opro_auth_grants, :code,          :unique => true
  add_index :opro_auth_grants, :access_token,  :unique => true
  add_index :opro_auth_grants, :refresh_token, :unique => true
end