Sha256: 3ff0f253b2936dd5750ac357826f9d2fbd559ab88b690429b37e4c7bf68fb788

Contents?: true

Size: 716 Bytes

Versions: 6

Compression:

Stored size: 716 Bytes

Contents

class AddActivityLoggingToUsers < ActiveRecord::CompatibleLegacyMigration.migration_class
  def self.up
    add_column :users, :last_login_at,     :datetime, default: nil
    add_column :users, :last_logout_at,    :datetime, default: nil
    add_column :users, :last_activity_at,  :datetime, default: nil
    add_column :users, :last_login_from_ip_address, :string, default: nil

    add_index :users, [:last_logout_at, :last_activity_at]
  end

  def self.down
    remove_index :users, [:last_logout_at, :last_activity_at]

    remove_column :users, :last_activity_at
    remove_column :users, :last_logout_at
    remove_column :users, :last_login_at
    remove_column :users, :last_login_from_ip_address
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sorcery-0.12.0 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.11.0 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.10.3 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.10.2 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.10.1 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.10.0 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb