Sha256: d767caab072852d31f36e87da7bdd6278a508efd7caf62cf6dd72f30e060dd7b

Contents?: true

Size: 746 Bytes

Versions: 1

Compression:

Stored size: 746 Bytes

Contents

# Generated by Authkit.
#
# Create an user_sessions table for managing user logins.
class CreateUserSessions < ActiveRecord::Migration[5.0]
  def self.up
    create_table :user_sessions do |t|
      t.integer  :user_id
      t.datetime :accessed_at
      t.datetime :revoked_at
      t.datetime :logged_out_at
      t.datetime :sudo_enabled_at
      t.string   :ip
      t.string   :user_agent
      t.string   :remember_token

      t.timestamps null: false
    end

    add_index :user_sessions, :remember_token, :unique => true
    add_index :user_sessions, [:accessed_at, :revoked_at, :logged_out_at], :name => 'index_user_sessions_active'
    add_index :user_sessions, :user_id
  end

  def self.down
    drop_table :user_sessions
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
authkit-0.7.0 lib/generators/authkit/templates/db/migrate/create_user_sessions.rb