$ gitlab-rails console
User.where("created_at < ?", 60.days.ago).find_each do |user|
if user.name.length != 10
puts user.name
end
end
User.where("length(name) = ?", 10).find_each do |user|
puts "#{user.id};#{user.name};#{user.email}"
end
User.where("length(username) = ? and length(name) = ?", 10, 10).find_each do |user|
puts "#{user.id};#{user.username};#{user.name};#{user.email}"
end
users = User.where("length(username) = ? and length(name) = ? and id >= ? and id != ?", 10, 10, 240, 734)
users.find_each do |user|
puts "#{user.id};#{user.username};#{user.name};#{user.email}"
end
users = User.where("length(username) = ? and length(name) = ? and id >= ? and id != ?", 10, 10, 240, 734)
users.find_each do |user|
user.destroy
end
emails = ["doox6paigu4M@doox6paigu4M.com", "eeThiel3eex9@eeThiel3eex9.com"]
users = User.where("email in (?)", emails)
users.find_each do |user|
puts user.name
end