Sha256: 8dd261ed8cfcb36f939d06f396f2680d44c3378f7ec00276476ce5f739595a9a

Contents?: true

Size: 690 Bytes

Versions: 10

Compression:

Stored size: 690 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

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
authpwn_rails-0.21.1 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.21.0 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.20.0 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.19.0 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.18.2 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.18.1 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.18.0 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.17.2 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.17.1 lib/authpwn_rails/generators/templates/003_create_credentials.rb
authpwn_rails-0.17.0 lib/authpwn_rails/generators/templates/003_create_credentials.rb