Project

General

Profile

Defect #43838 » 0001-Adds-index-on-user-login-and-lower-login.patch

Marius BĂLTEANU, 2026-02-26 03:04

View differences:

app/helpers/application_helper.rb
1289 1289
                link = link_to_project(p, {:only_path => only_path}, :class => 'project')
1290 1290
              end
1291 1291
            when 'user'
1292
              u = User.visible.find_by(login: name.downcase)
1292
              u = User.visible.find_by_login(name.downcase)
1293 1293
              link = link_to_user(u, :only_path => only_path) if u
1294 1294
            end
1295 1295
          elsif sep == "@"
1296 1296
            name = remove_double_quotes(identifier)
1297
            u = User.visible.find_by(login: name.downcase)
1297
            u = User.visible.find_by_login(name.downcase)
1298 1298
            link = link_to_mention(u, obj, only_path: only_path) if u
1299 1299
          end
1300 1300
        end
db/migrate/20260221060647_add_index_to_users_login.rb → db/migrate/20260225170822_add_index_to_users_login.rb
1 1
class AddIndexToUsersLogin < ActiveRecord::Migration[8.1]
2
  def change
2
  def up
3 3
    add_index :users, :login
4 4
  end
5

  
6
  def down
7
    remove_index :users, :login
8
  end
5 9
end
db/migrate/20260225170833_add_index_to_users_lower_login.rb
1
class AddIndexToUsersLowerLogin < ActiveRecord::Migration[8.1]
2
  def up
3
    add_index :users, "(lower(login))", name: "index_users_on_lower_login"
4
  end
5

  
6
  def down
7
    remove_index :users, name: "index_users_on_lower_login"
8
  end
9
end
(3-3/6)