Class: CreateAuths

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/authkit/templates/db/migrate/create_auths.rb

Overview

Generated by Authkit.

Create an auths table for managing OAuth authentication.

Class Method Summary collapse

Class Method Details

.downObject



25
26
27
# File 'lib/generators/authkit/templates/db/migrate/create_auths.rb', line 25

def self.down
  drop_table :auths
end

.upObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/generators/authkit/templates/db/migrate/create_auths.rb', line 5

def self.up
  create_table :auths do |t|
    t.integer  :user_id
    t.string   :provider
    t.string   :uid
    t.string   :email
    t.boolean  :verified_email
    t.string   :token
    t.datetime :token_expires_at
    t.string   :refresh_token
    t.string   :secret_token
    t.text     :env

    t.timestamps null: false
  end

  add_index :auths, :user_id
  add_index :auths, [:provider, :uid]
end