Sha256: d3602b70970b326d2363dc0a91695523aadbccbfd8377b5e1bcac0029a0ce3b3

Contents?: true

Size: 726 Bytes

Versions: 11

Compression:

Stored size: 726 Bytes

Contents

class CreateCredentials < ActiveRecord::Migration
  def change
    create_table :credentials do |t|
      t.references :user, null: false
      t.string :type, limit: 32, null: false
      t.string :name, limit: 128, null: true

      t.timestamp :updated_at, null: false

      t.binary :key, limit: 2.kilobytes, null: true
    end

    # All the credentials (maybe of a specific type) belonging to a user.
    add_index :credentials, [:user_id, :type], unique: false
    # A specific credential, to find out what user it belongs to.
    add_index :credentials, [:type, :name], unique: true
    # Expired credentials (particularly useful for tokens).
    add_index :credentials, [:type, :updated_at], unique: false
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
authpwn_rails-0.16.2 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.16.1 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.16.0 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.15.3 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.15.2 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.15.1 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.15.0 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.14.3 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.14.2 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.14.1 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.14.0 lib/authpwn_rails/generators/templates/003_create_credentials.rb