Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-06-15 13:10:41 +0300
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-06-15 13:10:41 +0300
commitb2df11856144e91c84f51e8934e10e21f4f3fa70 (patch)
tree354b497c7d381394e8d1b80902ccff53a69524f2 /lib/gitlab/database.rb
parent7dc08033b9cbd2876ed444878525d9f8bbfcef64 (diff)
Random selection now also works for MySQL
Diffstat (limited to 'lib/gitlab/database.rb')
-rw-r--r--lib/gitlab/database.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb
index 04fa6a3a5de..d76ecb54017 100644
--- a/lib/gitlab/database.rb
+++ b/lib/gitlab/database.rb
@@ -30,6 +30,10 @@ module Gitlab
order
end
+ def self.random
+ Gitlab::Database.postgresql? ? "RANDOM()" : "RAND()"
+ end
+
def true_value
if Gitlab::Database.postgresql?
"'t'"