Sha256: eafbb5b5d25f99c2535675240cfcd39a5155bb789dfb39563841fea62febff2f

Contents?: true

Size: 1.35 KB

Versions: 10

Compression:

Stored size: 1.35 KB

Contents

class CreateDeviseOauth2ProvidableSchema < ActiveRecord::Migration
  def change
    create_table :oauth2_clients do |t|
      t.string :name
      t.string :redirect_uri
      t.string :website
      t.string :identifier
      t.string :secret
      t.timestamps
    end

    change_table :oauth2_clients do |t|
      t.index :identifier, :unique => true
    end

    create_table :oauth2_access_tokens do |t|
      t.belongs_to :user, :client, :refresh_token
      t.string :token
      t.datetime :expires_at
      t.timestamps
    end

    change_table :oauth2_access_tokens do |t|
      t.index :token, :unique => true
      t.index :expires_at
      t.index :user_id
      t.index :client_id
    end

    create_table :oauth2_refresh_tokens do |t|
      t.belongs_to :user, :client
      t.string :token
      t.datetime :expires_at
      t.timestamps
    end

    change_table :oauth2_refresh_tokens do |t|
      t.index :token, :unique => true
      t.index :expires_at
      t.index :user_id
      t.index :client_id
    end

    create_table :oauth2_authorization_codes do |t|
      t.belongs_to :user, :client
      t.string :token
      t.datetime :expires_at
      t.timestamps
    end

    change_table :oauth2_authorization_codes do |t|
      t.index :token, :unique => true
      t.index :expires_at
      t.index :user_id
      t.index :client_id
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
brycesch-devise_oauth2_providable-1.2.8 db/migrate/20111014160714_create_devise_oauth2_providable_schema.rb
brycesch-devise_oauth2_providable-1.2.7 db/migrate/20111014160714_create_devise_oauth2_providable_schema.rb
brycesch-devise_oauth2_providable-1.2.6 db/migrate/20111014160714_create_devise_oauth2_providable_schema.rb
brycesch-devise_oauth2_providable-1.2.5 db/migrate/20111014160714_create_devise_oauth2_providable_schema.rb
brycesch-devise_oauth2_providable-1.2.4 db/migrate/20111014160714_create_devise_oauth2_providable_schema.rb
brycesch-devise_oauth2_providable-1.2.3 db/migrate/20111014160714_create_devise_oauth2_providable_schema.rb
brycesch-devise_oauth2_providable-1.2.2 db/migrate/20111014160714_create_devise_oauth2_providable_schema.rb
brycesch-devise_oauth2_providable-1.2.1 db/migrate/20111014160714_create_devise_oauth2_providable_schema.rb
brycesch-devise_oauth2_providable-1.2.0 db/migrate/20111014160714_create_devise_oauth2_providable_schema.rb
brycesch-devise_oauth2_providable-1.1.7 db/migrate/20111014160714_create_devise_oauth2_providable_schema.rb