Sha256: 1c78ace448cf555be4e1a133662c97d91b8e85d3ea4b4dcb3fe6f6e350318e5c

Contents?: true

Size: 1.12 KB

Versions: 7

Compression:

Stored size: 1.12 KB

Contents

class CreateOauthTables < ActiveRecord::Migration
  def self.up
    create_table :client_applications do |t|
      t.string :name
      t.string :url
      t.string :support_url
      t.string :callback_url
      t.string :key, :limit => 40
      t.string :secret, :limit => 40
      t.integer :user_id

      t.timestamps
    end
    add_index :client_applications, :key, :unique => true

    create_table :oauth_tokens do |t|
      t.integer :user_id
      t.string :type, :limit => 20
      t.integer :client_application_id
      t.string :token, :limit => 40
      t.string :secret, :limit => 40
      t.string :callback_url
      t.string :verifier, :limit => 20
      t.string :scope
      t.timestamp :authorized_at, :invalidated_at, :expires_at
      t.timestamps
    end

    add_index :oauth_tokens, :token, :unique => true

    create_table :oauth_nonces do |t|
      t.string :nonce
      t.integer :timestamp

      t.timestamps
    end
    add_index :oauth_nonces,[:nonce, :timestamp], :unique => true

  end

  def self.down
    drop_table :client_applications
    drop_table :oauth_tokens
    drop_table :oauth_nonces
  end

end

Version data entries

7 entries across 7 versions & 4 rubygems

Version Path
houston-oauth-plugin-0.5.1 lib/generators/active_record/oauth_provider_templates/migration.rb
panjiva-oauth-plugin-0.4.1 lib/generators/active_record/oauth_provider_templates/migration.rb
oauth-plugin-0.5.1 lib/generators/active_record/oauth_provider_templates/migration.rb
oauth-plugin-0.5.0 lib/generators/active_record/oauth_provider_templates/migration.rb
oauth-provider-0.5.0rc1 lib/generators/active_record/oauth_provider_templates/migration.rb
oauth-plugin-0.4.1 lib/generators/active_record/oauth_provider_templates/migration.rb
oauth-plugin-0.4.0 lib/generators/active_record/oauth_provider_templates/migration.rb