Sha256: 7ba9a3c43cc1e141bda8170edaa7dbb1e12b65b2eab2edd71dc43ec98a9ccde0
Contents?: true
Size: 1.48 KB
Versions: 1
Compression:
Stored size: 1.48 KB
Contents
require 'devise/schema' module Devise module Oauth2Providable module Schema def self.up(migration) migration.create_table :clients do |t| t.string :name t.string :redirect_uri t.string :website t.string :identifier t.string :secret t.timestamps end migration.add_index :clients, :identifier migration.create_table :access_tokens do |t| t.belongs_to :user, :client t.string :token t.datetime :expires_at t.timestamps end migration.add_index :access_tokens, :token migration.add_index :access_tokens, :expires_at migration.create_table :refresh_tokens do |t| t.belongs_to :user, :client t.string :token t.datetime :expires_at t.timestamps end migration.add_index :refresh_tokens, :token migration.add_index :refresh_tokens, :expires_at migration.create_table :authorization_codes do |t| t.belongs_to :user, :client t.string :token t.datetime :expires_at t.string :redirect_uri t.timestamps end migration.add_index :authorization_codes, :token migration.add_index :authorization_codes, :expires_at end def self.down(migration) migration.drop_table :refresh_tokens migration.drop_table :access_tokens migration.drop_table :clients end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
devise_oauth2_providable-0.1.0 | lib/devise_oauth2_providable/schema.rb |