Sha256: fb755531e36ed404a0ccb237a03b81d68c9037d1bcce0c9d22907b6cabfc7cae

Contents?: true

Size: 714 Bytes

Versions: 11

Compression:

Stored size: 714 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, %i[last_logout_at last_activity_at]
  end

  def self.down
    remove_index :users, %i[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

11 entries across 11 versions & 1 rubygems

Version Path
sorcery-0.17.0 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.16.5 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.16.4 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.16.3 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.16.2 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.16.1 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.15.1 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.16.0 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.15.0 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.14.0 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb
sorcery-0.13.0 spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb