Sha256: ac61cc2b88e59c0456b68363331a6fd2fa5e9f76540cad41f6a50f03401ca0cb

Contents?: true

Size: 1.08 KB

Versions: 57

Compression:

Stored size: 1.08 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 => 20
      t.string :secret, :limit => 40
      t.integer :user_id

      t.timestamps
    end
    add_index :client_applications, :key, :unique
    
    create_table :oauth_tokens do |t|
      t.integer :user_id
      t.string :type, :limit => 20
      t.integer :client_application_id
      t.string :token, :limit => 20
      t.string :secret, :limit => 40
      t.string :callback_url
      t.string :verifier, :limit => 20
      t.timestamp :authorized_at, :invalidated_at
      t.timestamps
    end
    
    add_index :oauth_tokens, :token, :unique
    
    create_table :oauth_nonces do |t|
      t.string :nonce
      t.integer :timestamp

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

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

end

Version data entries

57 entries across 41 versions & 6 rubygems

Version Path
muck-oauth-0.2.0 db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.2.0 test/rails_root/db/migrate/20091210172015_create_oauth_tables.rb
muck-invites-0.1.11 test/rails_root/db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.11 test/rails_root/db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.11 db/migrate/20091210172015_create_oauth_tables.rb
muck-invites-0.1.10 test/rails_root/db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.9 test/rails_root/db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.9 db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.8 test/rails_root/db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.8 db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.7 test/rails_root/db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.7 db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.6 db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.6 test/rails_root/db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.5 test/rails_root/db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.5 db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.4 test/rails_root/db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.4 db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.3 test/rails_root/db/migrate/20091210172015_create_oauth_tables.rb
muck-oauth-0.1.3 db/migrate/20091210172015_create_oauth_tables.rb